$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2005-12-28 17:00:48
Hi Caleb,
--- Caleb Epstein <caleb.epstein_at_[hidden]> wrote: <snip>
> I've run the tests on an SMP machine and a single-CPU box.
> The SMP machine is running a Redhat 2.4.21 kernel and the test
> actually doesn't work properly on this platform. It seems
> that the receiver drops many packets and, because of the way
> the test is written, the program crashes when trying to print
> the incomplete result data. I added some debugging print
> statements that show the async_server receives about 75,000 of
> the 600,000 packets sent before it is forcefully stopped.
Yes, this is precisely the behaviour I am seeing on my single
processor machine. My linux kernel version is 2.6.8, so perhaps
it is something that changed between 2.6.8 and 2.6.14.
> When I run the tests on my single-CPU machine running Linux
> 2.6.14.3 at home, the test completes properly. I've tried
> both the epoll and select-based reactors and the results are
> nearly identical (approx. 3x slower than sync).
Did you run the test using the CVS version of asio? Last night I
checked in an optimisation to make a non-blocking call before
putting the socket into select/epoll/etc. This reduces the
performance of the sync calls a bit, but I have just realised
there is a further optimisation that eliminates this cost.
For me, the CVS version of asio (plus a 1000 microsecond sleep
every 128 iterations of the sync client, but without the sync
call optimisation) gives the following results:
--- ASYNC...
### TIME: total = 3.09885; iterations = 100000; iteration =
3.09885e-05; iterations/second = 32270.1
### TIME: total = 2.37491; iterations = 100000; iteration =
2.37491e-05; iterations/second = 42106.9
### TIME: total = 2.37707; iterations = 100000; iteration =
2.37707e-05; iterations/second = 42068.6
### TIME: total = 0.668798; iterations = 100000; iteration =
6.68798e-06; iterations/second = 149522
-- ...ASYNC: average iterations/second = 42087.7
--- SYNC...
### TIME: total = 2.03626; iterations = 100000; iteration =
2.03626e-05; iterations/second = 49109.7
### TIME: total = 2.02494; iterations = 100000; iteration =
2.02494e-05; iterations/second = 49384.1
### TIME: total = 2.02348; iterations = 100000; iteration =
2.02348e-05; iterations/second = 49419.7
### TIME: total = 2.01938; iterations = 100000; iteration =
2.01938e-05; iterations/second = 49520.1
### TIME: total = 2.01489; iterations = 100000; iteration =
2.01489e-05; iterations/second = 49630.6
### TIME: total = 2.06713; iterations = 100000; iteration =
2.06713e-05; iterations/second = 48376.2
-- ...SYNC: average iterations/second = 49488.6
Note that the test has not been modified to use the custom
allocation support either.
Cheers,
Chris