Avoid global variable reference - #212
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 |
|
You can use |
ref: https://github.com/nodejs/node/search?l=JavaScript&q=primordials+Object