in reply to Re^3: Threads and fork and CLONE, oh my!
in thread Threads and fork and CLONE, oh my!
For one-character keys, blessed hashes are slightly faster than the cached refaddr case. (I got 2% when I did the timings.) However, one-character keys are rather unrealistic, and definitely not good programming practice.
For two-character keys, the performance is the same.
For three or more characters, cached refaddr is faster! I think five characters is realistic, and their performance is 2% slower. For ten characters, 7% slower!
So if I were to call a winner, cached refaddr would be it.
On another minor note, 0+$self yields the same result as the refaddr function. So you can eliminate 'use Scalar::Util', and just cache 0+$self.
Remember: There's always one more bug.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Threads and fork and CLONE, oh my!
by adrianh (Chancellor) on Sep 18, 2005 at 08:28 UTC | |
Re^5: Threads and fork and CLONE, oh my!
by xdg (Monsignor) on Sep 16, 2005 at 18:26 UTC | |
by demerphq (Chancellor) on Nov 15, 2005 at 14:49 UTC | |
Re^5: Threads and fork and CLONE, oh my!
by demerphq (Chancellor) on Nov 15, 2005 at 14:41 UTC |