
On 29 October 2010 15:02, Daniel Walker <daniel.j.walker@gmail.com> wrote:
Result (Debug): Defining BOOST_FUNCTION_USE_STATIC_EMPTY yields a 18% decrease in time overhead per call but doubles the space overhead per type.
Does it? Presumably in the non-static-empty case the NULL pointer check and throw are getting inlined, resulting in more code space overhead the more times a given type is reused (which is typical, at least in my experience)? Projects low on static space tend to be low on code space as well. One would expect the code savings overhead to be amortized fairly quickly.
So, I think the current boost::function implementation is certainly the right default, since many users would not appreciate doubling the static space overhead for a time savings of less than 10% per call.
Is it? Projects low on static space usually don't have cycles to burn, either. -- Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404