Boost logo

Boost Users :

From: Nat Goodspeed (nat_at_[hidden])
Date: 2007-10-11 12:48:21


Erik wrote:
> Andrew Holden skrev:
>> Erik wrote:
>>
>>> Unfortunately it does not look so good for BOOST_FOREACH after
>>> this modification. It will increase to 24 instructions, while the
>>> handcoded is still only 21.
>>>
>> Forgive me if this was answered in an earlier post, but how complex
>> is the loop body, including the complexity of any functions it
>> calls?

> The answer is available by executing the test script in my previous
> post and then running the diff command that I showed in that post:
> The size of the loop body increases from 6 to 7 instructions and the
> code before the loop increases with 2 instructions.

No, that's not what Andrew asked. He was asking: in a *real* loop in
your real application, wouldn't the work being done by the loop
completely dwarf the loop-control overhead? In production code, how many
loops do we write with such trivial bodies that the loop-control
overhead makes a measurable difference?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net