in reply to Re^3: What is the most efficient way to see if a hash is empty?
in thread What is the most efficient way to see if a hash is empty?
Thanks for the links to Perl source code and the dump.
Key counts being stored would be consistent with BrowserUk's observations that there seems to be little difference between scalar keys on an empty and full hash. But scalar(%h) is returning counts of used and allocated buckets, not key counts.
Given moritz's observations of a significant difference in empty and non-empty hashes for %h and the lack of an obvious dump field to store bucket counts in Devel::Peek output, I would think that %h is doing some sort of looping and is O(number of buckets).
Best, beth
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: What is the most efficient way to see if a hash is empty?
by moritz (Cardinal) on Apr 28, 2009 at 11:06 UTC | |
by ELISHEVA (Prior) on Apr 28, 2009 at 11:21 UTC | |
by BrowserUk (Patriarch) on Apr 28, 2009 at 12:23 UTC | |
|
Re^5: What is the most efficient way to see if a hash is empty?
by Anonymous Monk on Apr 28, 2009 at 10:13 UTC |