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

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

Merged
merged 1 commit into from
May 3, 2013

Conversation

rajeshsegu
Copy link

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
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
Author

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

@WebsiteDeveloper
Copy link
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
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
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
Author

I thought you had already merged the pull request.

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

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

This pull request was closed.
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