deep-map-keys
deep-map-keys copied to clipboard
Circular reference handling has huge performance cost for huge geojson documents
deep-map-keys has slow performance on geojson documents with long list of coordinates. Example which shows the issue:
// test.js
_ = require('lodash');
dmk = require('deep-map-keys');
// Simulate huge geojson document
doc = _.range(1000000).map(r => [r, r]);
console.time('dmk');
dmk(doc, x => x);
console.timeEnd('dmk');
$ npm i [email protected]
$ node test.js
dmk: 757.423ms
$ npm i [email protected]
$ node test.js
dmk: 9302.293ms
My suggestion would be to add an option to disable circular reference handling.