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

[CLOSED] Issue #3669 - Use call() for better performance #3456

Open
core-ai-bot opened this issue Aug 29, 2021 · 7 comments
Open

[CLOSED] Issue #3669 - Use call() for better performance #3456

core-ai-bot opened this issue Aug 29, 2021 · 7 comments

Comments

@core-ai-bot
Copy link
Member

Issue by rajeshsegu
Wednesday May 01, 2013 at 05:19 GMT
Originally opened as adobe/brackets#3687


call() performance twice as better than apply()

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


rajeshsegu included the following code: https://github.com/adobe/brackets/pull/3687/commits

@core-ai-bot
Copy link
Member Author

Comment by WebsiteDeveloper
Wednesday May 01, 2013 at 05:45 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by rajeshsegu
Wednesday May 01, 2013 at 05:48 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by WebsiteDeveloper
Wednesday May 01, 2013 at 06:06 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by rajeshsegu
Wednesday May 01, 2013 at 06:38 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by WebsiteDeveloper
Wednesday May 01, 2013 at 06:46 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by rajeshsegu
Wednesday May 01, 2013 at 06:48 GMT


I thought you had already merged the pull request.

@core-ai-bot
Copy link
Member Author

Comment by WebsiteDeveloper
Wednesday May 01, 2013 at 06:52 GMT


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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant