The stupid question is the question not asked | |
PerlMonks |
Re^4: Class::Std::Fast cache and threadsby BrowserUk (Patriarch) |
on Oct 13, 2010 at 15:52 UTC ( [id://865108]=note: print w/replies, xml ) | Need Help?? |
You may have missed is that it's caching a blessed scalar ref, which means that on the next new call, it can just pop an item of the cache instead of blessing a new object. Blessing a ref takes an infinitesimal amount of time. My benchmark:
And if you removed all the cache related conditionals, it would be quicker still. It would also avoid your original problem Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|