Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Issue #3669 - Use call() for better performance#3687

Merged
jbalsas merged 1 commit intoadobe:masterfrom
rajeshsegu:master
May 3, 2013
Merged

Issue #3669 - Use call() for better performance#3687
jbalsas merged 1 commit intoadobe:masterfrom
rajeshsegu:master

Conversation

@rajeshsegu
Copy link
Copy Markdown

call() performance twice as better than apply()

http://jsperf.com/call-apply-segu

call() performance twice as better than apply()

http://jsperf.com/call-apply-segu
@WebsiteDeveloper
Copy link
Copy Markdown
Contributor

@rajeshsegu
you could search the src folder for other occurences of apply because i did a quick search and many more showed up.

@rajeshsegu
Copy link
Copy Markdown
Author

I did, but I thought I would try with a small change first. :)

@WebsiteDeveloper
Copy link
Copy Markdown
Contributor

i think it would be no problem to changed the others too, because it isn't a very complicated change ;)
and so all would be done at once.

@rajeshsegu
Copy link
Copy Markdown
Author

I think it would be really hard to move all the existing apply() to call() as array object is passed in most ocassions.

Obj.prototype.func.apply(scope, arrayObj);

We could at-least start using .call() when we have definite set of arguments.

@rajeshsegu rajeshsegu closed this May 1, 2013
@WebsiteDeveloper
Copy link
Copy Markdown
Contributor

yeah you're right. didn't think of that.
why did you close this?
By the way its easier to do pull requests from seperate branches. ;) Makes working a lot easier.

@rajeshsegu
Copy link
Copy Markdown
Author

I thought you had already merged the pull request.

@rajeshsegu rajeshsegu reopened this May 1, 2013
@WebsiteDeveloper
Copy link
Copy Markdown
Contributor

actually i dont't have commit rights for the repo ;)
Also if it gets merged github will show the status as merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants