Re: Object pooling
Eric Sosman wrote:
To put it another way: When did "cache" become a dirty word?
Around when "cash" did.
The problem is the same with both - the real thing is great but there are too
many pretenders. People tire of fairy gold and become disillusioned.
On one recent project my rule of thumb was, "Anything that claims to be a
cache isn't."
Some so-called "caches" were slower than the operation they buffered, under
multi-threaded production loads that is, not single-threaded development
environments. Other "caches" sit on top of OS or hardware caches that already
are fast enough.
Such experiences are common enough that the pendulum has swung. People hear
"Premature optimization is the root of all evil," as if it were "Optimization
is the root of all evil."
They are as wrong as their antagonists; obsessive knee-jerk anti-optimization
is as bad as obsessive knee-jerk failed attempts to optimize. The art, and
the measure of one's intelligence and wisdom, lies in the choice of when and
where to optimize, based on evidence from reality.
--
Lew
<http://www.indopedia.org/The_Life_of_Brian.html>
Brian (to adoring crowd): You've got to think for yourself! You're all
individuals!
Crowd (in unison): Yes, we're all individuals!
Brian (to adoring crowd): You're all different!
Crowd (in unison): Yes, we're all different!
Single voice (from within the crowd): I'm not.