Boost C++ Libraries: Ticket #4803: [function][patch] use a static "empty" target https://svn.boost.org/trac10/ticket/4803 <p> boost::function throws bad_function_call if invoked when empty. Currently, this is implemented by performing a pointer comparison at runtime. Alternatively, boost::function's empty state could be represented by a static vtable object targeting an "empty" function which throws bad_function_call when invoked. There has been a lot of interest in this alternative scheme, which would trade the time overhead of a pointer comparison for an increase in space overhead in the initialized static variable section of the executable's data segment. The degree to which this trade-off will improve performance depends on compiler optimization. The attached patch implements a configuration macro, BOOST_FUNCTION_USE_STATIC_EMPTY, which allows the user to make this trade-off. The patch includes updated documentation and tests. I verified that the updated test suite passes on gcc 4.2, 4.5 and msvc 7.1, 10. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4803 Trac 1.4.3 Daniel Walker Fri, 29 Oct 2010 19:41:37 GMT attachment set https://svn.boost.org/trac10/ticket/4803 https://svn.boost.org/trac10/ticket/4803 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">function_benchmark.tar.bz2</span> </li> </ul> <p> A simple benchmark system that can be used to compare the performance of boost::function and a function pointer. </p> Ticket Daniel Walker Tue, 02 Nov 2010 21:25:04 GMT attachment set https://svn.boost.org/trac10/ticket/4803 https://svn.boost.org/trac10/ticket/4803 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">signal_benchmark.tar.bz2</span> </li> </ul> <p> Measure the impact of the static empty state on the performance of boost::signal. </p> Ticket Daniel Walker Thu, 11 Nov 2010 20:05:42 GMT attachment set https://svn.boost.org/trac10/ticket/4803 https://svn.boost.org/trac10/ticket/4803 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">signal_benchmark.tar.2.bz2</span> </li> </ul> <p> Use a dummy_mutex and other changes. </p> Ticket Daniel Walker Thu, 11 Nov 2010 20:42:57 GMT attachment set https://svn.boost.org/trac10/ticket/4803 https://svn.boost.org/trac10/ticket/4803 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">signal_benchmark.tar.3.bz2</span> </li> </ul> <p> Use a dummy_mutex, normalize by # of slots, etc. </p> Ticket Daniel Walker Sat, 13 Nov 2010 19:13:41 GMT attachment set https://svn.boost.org/trac10/ticket/4803 https://svn.boost.org/trac10/ticket/4803 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">djw_function_static_empty.patch</span> </li> </ul> <p> Implements BOOST_FUNCTION_USE_STATIC_EMPTY config macro with tests and docs. </p> Ticket