On Aug 13, 2009, at 4:27 PM, Krzysztof KosiƄski wrote:

o memory allocations when adding a reference = better performance.

That may or may not be true. However the bottom line for performance  

items is to get solid metrics before and after.


ObjectRefBase acts as an intrusive list. Look here:

http://www.boost.org/doc/libs/1_39_0/doc/html/intrusive/performance.html

In particular look at the back insertion / deletion benchmark (what we're

doing when adding or replacing a reference) - it shows at least 3x better

performance for an intrusive list of small objects.


Yes, but you're missing the main point.

You are benchmarking a *structure*, not an *application*.

It's the use case that is important. In the context of actual work is what really matters. Now I don't you you would ever fall into this trap, but the classic mistake here is spending time optimizing the system idle loop.


Much like in the early days of Pentium processors many people would use floating point because the CPU finally had the coprocessor built-in. However, they'd miss that getting things in and out of the fp registers stole more than the time gained, and would end up with a net loss.

Or conversely they would use fixed-point integer implementations "for performance", but could gain actual app speedups by using floating point variables and staying in fp.

A more recent example is using a GPU to process calculations. For many things, including some showcased at the most recent LGM, the main bottleneck is going in and out of the graphics card/memory. The chips themselves can do operations much faster than the overall system can feed it.