November 05, 2016Filed under micro#javascript#software developmentMarkdown source

Pro tip: use Map and not Object for dictionaries/hash-tables in JavaScript. Performance difference is A LOT. (I haven’t measured, but for a simple example I was playing with (~12k items) it was at least a couple orders of magnitude.)

Edit: Belay that: the problem was an allocation-speed issue: I wasn’t reallocating a Map. Updating in-place is much more comparable.