develooper Front page | perl.perl5.porters | Postings from May 2013

Should we make hashes return keys in FIFO order?

Thread Next
May 10, 2013 07:52
Should we make hashes return keys in FIFO order?
Message ID:
Various languages make their hashes return items inserted into them in
first in first out order. I was wondering if we should do the same.

The principle disadvantage is a memory penalty per key.

The advantages are varied, and range from usefully predictable
semantics regardless of underlying hash function, which has positive
security implications, and would make keys(), values() and each()
faster. It would also make insertion into a hash during traversal

I think I will try to do an implementation so it can be benchmarked
and compared to the existing code so we can compare numbers. Because
we support lazy deletes, I think we can get away with a single
additional pointer per HE.


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About