Boost logo

Boost :

Subject: [boost] [function] improvements/proposals
From: Domagoj Saric (dsaritz_at_[hidden])
Date: 2010-01-18 03:28:03

A while back, in various threads more or less related to the topic, I posted
various ideas and/or code contributions to the effect of improving
boost::function in terms of efficiency (concentrated on invocation speed,
assignement performance/overhead and reducing template and RTTI bloat) and
configurability, however there was no "official response" as to whether it was
any good, or whether any of it would be accepted or what's wrong with it if
IMHO the results
- 'Speed': the test presented here modified to work with
boost::signals2 (because it is a header only library/does not require a
recompilation of boost if something in boost::function changes) with the dummy
mutex/no threading support and a simple recompilation with the new
boost::function<> code yielded a ~10% boost, changing the default policy to be
nothrow the boost doubled to ~20%
- 'Size': my real life project, that uses heavy metaprograming for generating
function objects (that as a consequence have _very_ long type names, and thus
RTTI records) to assign to boost::functions shrunk by ~10% simply by using the
modified boost::function (with RTTI features disabled)...This post has more detailed and
updated results when my project grew further (with an even bigger difference)
show/hint that there is room for improvement in boost::function and therefor
warrant atleast some kind of response (even if along the lines of 'it's no
good' or 'there is no time for this now')...which is the reason for (re)posting
this (in a separate thread).

The relevant threads with more detail are these:

since then I've moved the modified code from the vault into the sandbox SVN
(under the obvious name "function" :)

 "That men do not learn very much from the lessons of history is the most
important of all the lessons of history."
 Aldous Huxley 

Boost list run by bdawes at, gregod at, cpdaniel at, john at