I recently found myself needing key-value pair lookup functionality while keeping entries sorted in order and got really excited about ES6 Maps.
After some research I made some benchmarks using my app’s data and code. I was getting much better performance with bulk insertion using
However, when testing key-value lookup on real data in a 5000 iteration loop, the POJO was about about 68% faster actually. That took out some of the wind for me but…
The deal-breaker came when I realized that
Map isn’t JSON
stringify-able - which I need to send the data to various microservices that share data. ES6 Maps have to be converted to an
Object first. That blew out any performance test as this added a significant bit of time onto my use-cases.
Anyone found anything similar or different to the above? Curious if anyone is making use of them.