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

Make findPrototypeId faster #847

Closed
tuchida opened this issue Mar 20, 2021 · 2 comments
Closed

Make findPrototypeId faster #847

tuchida opened this issue Mar 20, 2021 · 2 comments
Labels
Performance Issues related to the performance of the Rhino engine

Comments

@tuchida
Copy link
Contributor

tuchida commented Mar 20, 2021

ref. #837 (comment)

It seems to be faster to use Java7's strings switch for findPrototypeId.
master...tuchida:improve-findPrototypeId
https://gist.github.com/tuchida/a8141c9946b0b597cdb2b171a3b8be5f

I think it is better to change to strings switch as it is more maintainable than generating code with org.mozilla.javascript.tools.idswitch.Main.
If there seems to be no problem, I will create a Pull Request.

@tuchida tuchida mentioned this issue Mar 20, 2021
@rbri
Copy link
Collaborator

rbri commented Mar 20, 2021

Have done a short test by hacking SwitchGenerator to generate your switch. After regenerating nearly all classes i found no real difference when running Test262SuiteTest.

Will do some more testing... but if this seems to have no negative effect maybe we can use this to have a more cleaner code.

@tuchida
Copy link
Contributor Author

tuchida commented Mar 26, 2021

Thank you for fixed and merged.

@tuchida tuchida closed this as completed Mar 26, 2021
@p-bakker p-bakker added the Performance Issues related to the performance of the Rhino engine label Oct 13, 2021
@p-bakker p-bakker added this to the Release 1.7.14 milestone Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Issues related to the performance of the Rhino engine
Projects
None yet
Development

No branches or pull requests

3 participants