Closed philcchen closed 6 years ago
Optimization around for-each loops (https://jsperf.com/fast-array-foreach ) for a comparison.
Memoization of normalizeKey function, would like a sanity check to make sure that normalizeKey never gets called with a mutable object.
normalizeKey
Note: the memoization here isn't necessarily a runtime optimization, but a garbage collection optimization/trade-off
Was seeing excessive GC (especially by Firefox) when running without the memoized keys in production environment
Demo: quicktests | fiddle
Optimization around for-each loops (https://jsperf.com/fast-array-foreach ) for a comparison.
Memoization of
normalizeKey
function, would like a sanity check to make sure thatnormalizeKey
never gets called with a mutable object.Note: the memoization here isn't necessarily a runtime optimization, but a garbage collection optimization/trade-off
Was seeing excessive GC (especially by Firefox) when running without the memoized keys in production environment