Uh oh!
There was an error while loading. Please reload this page.
events: refactor to use more primordials - #36304
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%
Uh oh!
There was an error while loading. Please reload this page.
aduh95
commented
Nov 29, 2020
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Darshan Sen <raisinten@gmail.com>
085a66d to
4355063Compareaduh95
commented
Dec 17, 2020
aduh95
commented
Dec 17, 2020
@RaisinTen it seems it didn't have much impact at all: Details |
RaisinTen
commented
Dec 17, 2020
@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 |
Uh oh!
There was an error while loading. Please reload this page.
aduh95
commented
Dec 18, 2020
It seems to indeed have a significant impact on Details
By replacing |
RaisinTen
commented
Dec 18, 2020
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 |
ExE-Boss
commented
Dec 18, 2020
A possible solution might be to implement |
aduh95
commented
Dec 21, 2020
Well, In other words, calling |
aduh95
commented
Dec 22, 2020
aduh95
commented
Dec 22, 2020
@mscdex I removed the changes that were causing perf regressions, PTAL Details |
nodejs-github-bot
commented
Dec 25, 2020
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>
lib: add `SafeArray` to `primordials` and use it for `FreeList` Refs: nodejs#36304 (comment) Refs: nodejs#36565 Signed-off-by: ExE Boss <ExE-Boss@code.ExE-Boss.tech>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes