-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
events: refactor to use more primordials #36304
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to cause some performance regressions:
events/ee-add-remove.js n=1000000 *** -20.86 % ±2.52% ±3.37% ±4.41%
events/ee-once.js argc=0 n=20000000 *** -8.22 % ±3.13% ±4.17% ±5.43%
events/ee-once.js argc=1 n=20000000 *** -7.36 % ±2.12% ±2.83% ±3.68%
events/ee-once.js argc=4 n=20000000 *** -6.46 % ±2.22% ±2.97% ±3.88%
events/eventtarget.js listeners=10 n=1000000 *** -10.51 % ±5.93% ±7.91% ±10.33%
events/eventtarget.js listeners=5 n=1000000 *** -9.26 % ±4.76% ±6.35% ±8.30%
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/727/ (queued, will 404 until it starts) |
Perf regression is gone for
I'll try to investigate this further. |
Co-authored-by: Darshan Sen <[email protected]>
085a66d
to
4355063
Compare
@RaisinTen it seems it didn't have much impact at all:
|
@aduh95 hmm, I just found what I missed: if (result !== undefined && result !== null) { This guarded the How did u fix the performance issue in I was thinking about reverting the Did u ever notice |
It seems to indeed have a significant impact on
By replacing |
Should we prefer safety over performance here? |
Well, In fact, That said, there probably isn’t much that we can do here, given that Lines 446 to 455 in df98f27
|
A possible solution might be to implement |
Well, In other words, calling |
@mscdex I removed the changes that were causing perf regressions, PTAL
|
Landed in 88fb8e4...997f2fc |
PR-URL: #36304 Reviewed-By: Rich Trott <[email protected]>
PR-URL: #36304 Reviewed-By: Rich Trott <[email protected]>
PR-URL: #36304 Reviewed-By: Rich Trott <[email protected]>
PR-URL: #36304 Reviewed-By: Rich Trott <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes