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: prefer .forEach over for...in and for...of #1281

Merged
merged 1 commit into from Dec 22, 2023

Conversation

ghiscoding
Copy link
Owner

  • as per this article Measuring Performance of Different JavaScript Loop Types, the for...in and for...of aren't the most optimized for loops, the for and .forEach are more the most optimized methods across all browser engine and the for...in seems to be the worst to use and should be avoided when dealing with large dataset which can often be the case with this project

- as per this article [Measuring Performance of Different JavaScript Loop Types](https://blog.bitsrc.io/measuring-performance-of-different-javascript-loop-types-c0e9b1d193ed), the `for...in` and `for...of` aren't the most optimized for loops, the `for` and `.forEach` are more the most optimized methods across all browser engine and the `for...in` seems to be the worst to use and should be avoided when dealing with large dataset which can often be the case with this project
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (f6dc75c) 88.0% compared to head (3ce8419) 88.0%.

Files Patch % Lines
packages/common/src/core/slickGrid.ts 21.3% 37 Missing ⚠️
packages/common/src/core/slickDataview.ts 0.0% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1281     +/-   ##
========================================
- Coverage    88.0%   88.0%   -0.0%     
========================================
  Files         198     198             
  Lines       21350   21361     +11     
  Branches     7099    7109     +10     
========================================
+ Hits        18786   18791      +5     
- Misses       2564    2570      +6     

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

@ghiscoding ghiscoding merged commit 9cc6941 into master Dec 22, 2023
4 of 5 checks passed
@ghiscoding ghiscoding deleted the chore/perf-for-loops branch December 22, 2023 22:37
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.

None yet

1 participant