Christopher Kohlhoff | 10 Mar 03:04
Favicon

Major implementation changes - testing help wanted

Hello all,

If you've wondered what I've been up to, I've been putting all my spare
cycles into a substantial reworking of asio's implementation. This
follows on from the earlier LinuxPerformanceImprovements effort,
although I decided some aspects of that work were too experimental to
include at this time. However, these improvements are not specific to
Linux.

*** These changes will definitely be included in boost 1.43.         ***
*** They need testing in real world applications before then.        ***
*** Please try them out and let me know of any problems asap.        ***
*** Don't assume others will find the bugs that affect your app! :-) ***

To test these changes with non-boost asio:

- check out the "asio-1-4-branch" branch from asio's CVS repository; or

- download a snapshot from
http://think-async.com/asio/asio-20100310.tar.gz

To test these changes with boost.asio:

- check out trunk from boost SVN; or

- download a snapshot from
http://think-async.com/asio/boost_asio_20100310.tar.gz

The API hasn't changed, so correct programs should compile as-is. The
good news is that by using this new implementation your programs should:

- compile faster

- compile smaller

- run faster.

I would be interested to hear how the above metrics fare in real
applications. From what I've seen, the code size changes are a big
winner. For example:

- On linux/x86-64, a fully async echo server can be made smaller than
20KB. (As reported by 'size'. Using -Os. Exceptions, rtti and threads
disabled.)

- On linux/x86-64, the size of libtorrent-rasterbar.so has been cut from
3415KB to 2784KB. (As reported by 'size'. Using -O2.)

- On Windows/x86, libtorrent's DLL has gone from 1712KB to 1572KB. (As
reported by 'dir'. Using msvc 8.0 with /O2.)

The more important behavioural changes include:

- Hidden threads (e.g. as used by the resolver, the select_reactor on
Windows) no longer make calls to handler copy constructors, destructors,
etc. It should now be easier for me to extend asio to support for new
types of async operation that require hidden threads, and have them make
the same guarantee.

- The io_service::post() function can give a stronger guarantee that it
won't throw, provided handler allocation and copy construction do not
throw.

Cheers,
Chris

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

Gmane