🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@danielhusar
Copy link
Contributor

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 :)

@dmethvin
Copy link
Member

dmethvin commented Feb 7, 2014

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.

@jaubourg
Copy link
Member

jaubourg commented Feb 7, 2014

I'd be interested in seeing whether the "special fast case" is really faster in modern browsers as well.

My thought exactly.

@danielhusar
Copy link
Contributor Author

@dmethvin
Copy link
Member

dmethvin commented Feb 7, 2014

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 .each() or Array#forEach you should use a loop.

Anyone else?

@jaubourg
Copy link
Member

jaubourg commented Feb 7, 2014

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.

@gibson042
Copy link
Member

And if perf is truly an issue you shouldn't be using .each() or Array#forEach you should use a loop.

👍
These all look close enough, and therefore probably not worth the size and complexity.

Edit: Except that the two modes are more different than they appear on first inspection. 😦
Still worth a look, though.

@danielhusar
Copy link
Contributor Author

Yeah they are not exactly the same, and removing this block will cause 2 ajax tests to fail.

@dmethvin dmethvin added this to the 1.12/2.2 milestone Mar 13, 2014
@gibson042
Copy link
Member

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.

@staabm
Copy link
Contributor

staabm commented Sep 4, 2014

In FF33 the fast path seems to be 2x faster then the usual path, see jsperfs
(and FF33 seems the fastest browser over all now, for the fast-case)

@danielhusar
Copy link
Contributor Author

Thanks, I have signed the CLA already.

@dmethvin
Copy link
Member

dmethvin commented Dec 4, 2014

Where does this stand? It sounded like @gibson042 was ready to land but it stalled.

@gibson042 gibson042 closed this in eeda11c Dec 9, 2014
gibson042 pushed a commit that referenced this pull request Dec 9, 2014
Closes gh-1510

(cherry picked from commit eeda11c)
@gibson042 gibson042 added the Core label Dec 9, 2014
@gibson042
Copy link
Member

Sorry about the delay!

@danielhusar
Copy link
Contributor Author

No worries, thanks for merging it :)

markelog pushed a commit that referenced this pull request Nov 10, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

5 participants