http://qs1969.pair.com?node_id=378729


in reply to Re: code execution speed and variable name length
in thread code execution speed and variable name length

so he doens't consider the added cost of storing lots of big keys.

Just wanted to add to this that keys in perl are reused. A key is stored only once, regardless of how many hashes it is used in. So while there is obviously an additional cost of using longer keys it doesnt mean that you will thousands of that key in memory if you have thousands of hashes that have that key within them. This also explains why hash keys are not normal scalar values (SV's).

I believe that it was Gurusamy Sarathy that did the work whit the intention of making hash based objects more memory efficient.


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi