From: David Abrahams (dave_at_[hidden])
Date: 2004-05-05 13:30:21
John Torjo <john.lists_at_[hidden]> writes:
> Dear boosters,
> In the "looping construct" thread, a while ago David Abrahams said
> that we should do a test, to compare all looping solutions.
> I've made such a test. It tests against:
> - keeping internal functions in crange<>
> - virtual functions
> - BOOST_FOREACH
> comparing to using raw iterators.
Where can we see the results?
> The tests are pretty heavy.
> I've tested on a Win2000 box/512 Mb of RAM/1.8Ghz Intel processor
> (laptop), VC7.1 with all optimizations on.
> It seems that Dave, you were right about the virtual functions - the
> vtable can be cached.
I didn't suggest that it'd be chached, but that some compiler might
notice that the actual derived type was fixed at compile-time and
eliminate the function pointer indirection, and that this was a
little more likely with the compiler's virtual tables than with some
simulation that we happen to write.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk