palantir / plottable

:bar_chart: A library of modular chart components built on D3
http://plottablejs.org/
MIT License
2.97k stars 224 forks source link

For-each loop optimization and memoize normalizeKey #3469

Closed philcchen closed 6 years ago

philcchen commented 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.

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

blueprint-bot commented 6 years ago

Fix line plot indices

Demo: quicktests | fiddle