events: refactor to use more primordials#36304
events: refactor to use more primordials#36304aduh95 wants to merge 13 commits intonodejs:masterfrom
Conversation
mscdex
left a comment
There was a problem hiding this comment.
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 <raisinten@gmail.com>
085a66d to
4355063
Compare
|
@RaisinTen it seems it didn't have much impact at all: Details |
|
@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 Details
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 Details |
|
Landed in 88fb8e4...997f2fc |
PR-URL: #36304 Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #36304 Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #36304 Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #36304 Reviewed-By: Rich Trott <rtrott@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes