Skip to content
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

perf(core): convert for..in to Object.keys().forEach for better perf #1370

Merged
merged 5 commits into from
Jan 27, 2024

Conversation

ghiscoding
Copy link
Owner

  • as mentioned in this Stack Overflow, Object.keys().forEach are quicker than for..in because the latter also loops through prototype chain.

- as mentioned in this [Stack Overflow](https://stackoverflow.com/a/43446317/1212166), `Object.keys().forEach` are quicker than `for..in` because the latter also loops through prototype chain.
Copy link

codecov bot commented Jan 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cec6502) 99.7% compared to head (554a14b) 99.8%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1370     +/-   ##
========================================
+ Coverage    99.7%   99.8%   +0.1%     
========================================
  Files         199     199             
  Lines       21565   21566      +1     
  Branches     7199    7200      +1     
========================================
+ Hits        21499   21503      +4     
+ Misses         59      57      -2     
+ Partials        7       6      -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ghiscoding ghiscoding merged commit 29111a9 into master Jan 27, 2024
5 checks passed
@ghiscoding ghiscoding deleted the perf/for-in-foreach branch January 27, 2024 01:16
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