Nicholas Porter
1 min readFeb 24, 2020

--

In a recent project we were using a NodeJS worker to parse large HTTP network archive files, +100mb of highly nested json each. We initially were using some lodash functions like `_.map` and `_.find`. We ended up replacing with the native `map` and `find` functions and saw significant improvement in speed.

To go a little further we eventually ended up replacing all iterators with either a vanilla `for loop` or `while loop`. Here we saw the most improvement.
Some files we parsed required iterating over 100 million times, so performance was a great consideration.

--

--

Nicholas Porter
Nicholas Porter

No responses yet