Replies: 1 comment 1 reply
-
Thanks for looking into this David! It is a small thing to change. How much effect it has can indeed differ, based on how well the JS engine can optimize the code (maybe in the next update of Firefox optimizes this case too 😉). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Recently I found out about the benefits of caching the
.length
property on iterations.I did a test and there is a benefit in firefox of about 10% and no impact on chrome.
I see on some comments in the source code there is an intention to change some of the loops, would it be desirable to also test for caching the length of the array?
Test
Reference
https://shamansir.github.io/JavaScript-Garden/
Beta Was this translation helpful? Give feedback.
All reactions