-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Remove value var form each function. #1510
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
Conversation
|
I tend to agree, can't really see why it's needed. Perhaps there was some perf reason? Can you put together a jsperf to see if that's the case? I'd be interested in seeing whether the "special fast case" is really faster in modern browsers as well. |
My thought exactly. |
|
Hi, http://jsperf.com/each-samples http://jsperf.com/jquery-each-modified-1 |
|
Interesting! I ran some more browsers through, the one marked Other is IE11. My feeling is that the "special fast case" isn't worth the extra code, it's a hair faster but if this loop overhead was truly an issue then people would be screaming that Firefox is unusable given its bad performance against the others. And if perf is truly an issue you shouldn't be using Anyone else? |
|
The results in firefox are frightening but since they're also consistent between the two paths in the most recent version, I'd be in favour of simplifying the code. |
👍 Edit: Except that the two modes are more different than they appear on first inspection. 😦 |
|
Yeah they are not exactly the same, and removing this block will cause 2 ajax tests to fail. |
|
Thanks again for the contribution! I'm ready to land this for 1.12/2.2, but you first need to sign our CLA with your GitHub email address. |
|
In FF33 the fast path seems to be 2x faster then the usual path, see jsperfs |
|
Thanks, I have signed the CLA already. |
|
Where does this stand? It sounded like @gibson042 was ready to land but it stalled. |
|
Sorry about the delay! |
|
No worries, thanks for merging it :) |
Hi guys,
I was thinking there no reason for having value var in "each" function as there no other operations with it.
But if its something on purpose I missed from style guide, sorry for PR and ignore :)