|
Boost : |
Subject: Re: [boost] Request For a feature - Templated virtual functions
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-12 21:45:39
AMDG
Michael Marcin wrote:
> This reminds me of a discussion that came up when Steven Watanabe's
> Switch library was reviewed.
>
> http://lists.boost.org/Archives/boost/2004/08/69787.php
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
different
branch each time.
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk