in reply to Re: Combining a hash into another
in thread Combining a hash into another

hash1: 10000 keys, hash2: 10000 keys duplicates 9000, added 1000 key/values slice 854559/s hash1 = 1000 keys, hash2 = 200 keys: duplicates 100 added 100 key/values slice 2673/s

Why does reducing the work slow things down?

Replies are listed 'Best First'.
Re^3: Combining a hash into another
by hangon (Deacon) on May 28, 2008 at 00:48 UTC

    Oops, my bad. Thanks for catching that ikegami. The info was from benchmark notes a few years old, so I don't really know what happened.

    My best guess is that the benchmarks shown for 10,000 key hashes were actually done on empty hashes. I ran those again and updated the post (also checked the other results). From this, the while-each and foreach loops appear to gain the speed advantage as the hashes get larger.