Boost logo

Boost :

Subject: [boost] [ASIO] Compilation improvements of 1.43 (well done)
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-05-08 04:59:01


Hello,

In release notes of 1.43.0 version of Boost.Asio I had noticed improvements
in compilation times and executable size.

I must admit: WELL DONE!!!

I'm in process of replacement of Boost.Asio event loop with my own that has very similar API but uses templates only where they absolutely necessary.

I did some comparisons of my CppCMS library that implements with Asio.

- HTTP server (tcp),
- SCGI-server (tcp+unix-sockets),
- FCGI-server (tcp+unix-sockets).
- Memcached-like blocking-client and non-blocking server (TCP).

Compiled with g++-4.3.2, on Debian, amd64, Linux 2.6.26
-------------------------------------------------------

Library size (after strip -s):
------------------------------

Boost.Asio 1.41.0 - 3,527,856
Boost.Asio 1.43.0 - 3,003,504
My AIO - 2,607,848 (2,455,344 cppcms-lib + 152,504 aio-lib).

Moving from 1.41 to 1.43 reduced library by 0.5mb and this is huge
difference However replacing Asio with my AIO (that hides almost
everything behind pimpl) reduced additional 0.4mb

Compilation times:

HTTP-Server (tcp)

1.41.0 - 12.87s
1.43.0 - 7.45s
my-aio - 4.30s

SCGI-Server (tcp&unix)

  note Asio requires template based implementation as Unix socket class
  is different from tcp/ip ones so code almost can't be shared.
  My-AIO has same class so the code is not template based

1.41.0 - 14.31s
1.43.0 - 7.12s
my-aio - 2.55s

Again - huge difference: moving from 1.41 to 1.43 reduces time by half,
but my-aio gives even better improvements.

----------------------------------------------

My Notes:

1. I'm really interested what had been done to give such huge
   improvements from 1.41 to 1.43?
2. Maybe it is wide to consider making Asio compiled library rather
   then header-only one?

Artyom
------------

P.S.: I replace ASIO with my own library for several reasons not connected
      to quality of this specific library (it is great) but rather with
      issues I have with Boost and it's design.

      Also my library influenced by boost.asio API so rewriting was
      almost as simple as running several "sed" scripts over the source
      code.

      


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