isaacs/node-lru-cache — pull request #8 by jldailey (2012-08-27 16:28:05+00:00)
Title: small performance improvement to lruWalk

With a large number of keys, the lruWalk() function becomes a bottleneck by creating a large temporary array.

This simply avoids that array. Internally, V8 is still doing some part of the linear work internally, because it does not become O(1) to key count, but it is 2x faster for 10k keys, and 4x faster for 100k keys.

http://jsperf.com/key-in-vs-object-keys

This also would not measure what should be a small improvement in pause times for the next garbage collection.