-
Notifications
You must be signed in to change notification settings - Fork 227
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
Avoid global variable reference #212
base: master
Are you sure you want to change the base?
Conversation
🤔
|
I don't understand this PR. It doesn't use Node.js primordials so what is this protecting against? |
Global variable reference greatly degrades the runtime performance as follows.
https://falsandtru.github.io/benchmark/suites/10/ This PR prevents the performance degradation. |
Can you show the difference by running eventemitter3 benchmarks before and after the change? |
The use of primordials caused performance regressions on Nodes.js not boost nodejs/node#29766. |
|
That issue lists two causes but this PR doesn't use either.
|
Yes, the point is that the use of primordials did not cause any performance improvement in Node.js |
Confirmed. Looks like it is difficult to improve the performance on browsers without decreasing the performance 1-2% on Node.js. |
Note |
ref: https://github.com/nodejs/node/search?l=JavaScript&q=primordials+Object