Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2005-12-21 00:54:15


On 12/20/05, Rene Rivera <grafik.list_at_[hidden]> wrote:
>
>
> I ran the same 100,000*1K*6*2*3 tests with both debug and release
> compiled code. As can be seen from the attached output in the best case,
> of release code, there is a 5.6% "overhead" from the async to sync
> cases. For the debug code the difference is a more dramatic 25.2%.

On Linux, the differences between async and sync results are much more
striking. Here are the results from Rene's program compiled with gcc
4.0.2-O2 on Linux
2.6 (epoll). I had to make a number of small changes to get it to compile,
and the SYNC test hangs at the end

 --- ASYNC...
### TIME: total = 4.62879; iterations = 100000; iteration = 4.62879e-05;
iterations/second = 21603.9
### TIME: total = 5.37136; iterations = 100000; iteration = 5.37136e-05;
iterations/second = 18617.3
### TIME: total = 5.03588; iterations = 100000; iteration = 5.03588e-05;
iterations/second = 19857.5
### TIME: total = 5.09588; iterations = 100000; iteration = 5.09588e-05;
iterations/second = 19623.7
### TIME: total = 4.60645; iterations = 100000; iteration = 4.60645e-05;
iterations/second = 21708.7
### TIME: total = 4.55167; iterations = 100000; iteration = 4.55167e-05;
iterations/second = 21970
-- ...ASYNC: average iterations/second = 19951.8
--- SYNC...
### TIME: total = 1.38579; iterations = 100000; iteration = 1.38579e-05;
iterations/second = 72161.2
### TIME: total = 1.3561; iterations = 100000; iteration = 1.3561e-05;
iterations/second = 73741
### TIME: total = 1.34804; iterations = 100000; iteration = 1.34804e-05;
iterations/second = 74181.9
### TIME: total = 1.35522; iterations = 100000; iteration = 1.35522e-05;
iterations/second = 73788.5
### TIME: total = 1.36956; iterations = 100000; iteration = 1.36956e-05;
iterations/second = 73016.4
### TIME: total = 22.2436; iterations = 100000; iteration = 0.000222436;
iterations/second = 4495.68
-- ...SYNC: average iterations/second = 73682

I had to interrupt the program by attaching a debugger to get it to run to
completion (explaining the low result for the last SYNC loop). One thread
seems to get stuck in a "recv" call (sync_server::run) that does not get
interrupted by main's call to s0.stop(). Not sure if this is a bug in the
test program or in asio.

--
Caleb Epstein
caleb dot epstein at gmail dot com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk