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

improve performance with cache length in a array loop #1654

Closed
wants to merge 1 commit into from
Closed

improve performance with cache length in a array loop #1654

wants to merge 1 commit into from

Conversation

suhaotian
Copy link

Two points:

  1. improve performance with cache length in a array loop;
  2. rewrite forEach to for;

Hope to improve the performance 👍 of a little help

@gaearon
Copy link
Contributor

gaearon commented Apr 21, 2016

cache length in a array loop;

This can be removed, it only has any effect in very old browsers.

@suhaotian
Copy link
Author

@gaearon okay...

@suhaotian suhaotian closed this Apr 21, 2016
@gaearon
Copy link
Contributor

gaearon commented Apr 21, 2016

I'd rather keep the rest as it is for readability. The forEach cost there is not essential because this code only executes once as opposed to the inner loops.

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