Skip to content

remove usage of the 'reduce...spread' pattern #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

schester44
Copy link

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

reduce usage of reduce spread pattern

1.1.1

remove reduce...spread pattern from added, updated, and deleted methods

remove the reduce...spread pattern for perf gains

reduce usage of reduce spread pattern

1.1.1

remove reduce...spread pattern from added, updated, and deleted methods
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling e6dd6f1 on schester44:master into 6296889 on mattphillips:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants