-
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
perf_hooks: reducing overhead of performance observer entry list #50008
Conversation
throw new ERR_ILLEGAL_CONSTRUCTOR(); | ||
} | ||
|
||
this[kBuffer] = ArrayPrototypeSort(entries, performanceObserverSorter); |
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.
I don't know if it's a common case or not, but it may/may not be worth guarding the sort with a conditional that checks if entries.length > 1
before sorting.
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.
I added, I got 8% faster for 1 item but degraded the else
path by ~8%, so I didn't think that was worth it since probably this queue will be called with more items than 1.
Landed in 328bdac |
PR-URL: nodejs#50008 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
PR-URL: #50008 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
PR-URL: nodejs#50008 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
Continuing the work started on nodejs/performance#109.
cc @nodejs/performance