Subject: Re: [boost] Request For a feature - Templated virtual functions
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-12 21:45:39
Michael Marcin wrote:
> This reminds me of a discussion that came up when Steven Watanabe's
> Switch library was reviewed.
That's quite different. The comparison there is between a control
construct (switch statement) and using some bit twiddling to look up data
in an array. Naturally, the straight line code is faster. If you store an
array of function pointers to call, the functionality being compared would
be more equivalent, but, that, of course, introduces the possibility of
branch mispredictions, forfeiting all the gains of using a perfect hash.
The test case there is also somewhat unrealistic in that it takes a
branch each time.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk