remove usage of the 'reduce...spread' pattern #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a PR in response to #46 . It aims to improve the speed of the package by removing the usage of the 'reduce...spread' pattern, in favor of traditional for loops.
Benchmark.js stats
added#original x 533,358 ops/sec ±0.70% (92 runs sampled)
added#new x 1,114,933 ops/sec ±0.63% (94 runs sampled)
updated#original x 391,597 ops/sec ±0.97% (91 runs sampled)
updated#new x 1,057,258 ops/sec ±0.47% (95 runs sampled)
deleted#original x 1,299,890 ops/sec ±0.54% (94 runs sampled)
deleted#new x 1,981,737 ops/sec ±1.09% (90 runs sampled)
detailed#original x 203,221 ops/sec ±0.60% (93 runs sampled)
detailed#new x 357,716 ops/sec ±0.36% (85 runs sampled)
diff#original x 244,553 ops/sec ±0.50% (91 runs sampled)
diff#new x 855,466 ops/sec ±0.97% (92 runs sampled)
Reference https://www.richsnapp.com/blog/2019/06-09-reduce-spread-anti-pattern