-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
performance.getEntriesByType returns entries out of order #42024
Comments
cc @gioragutt is this something you can fix while improving the performance of these APIs? |
@benjamingr improve in what way? Reduce redundant code or something deeper? |
@gioragutt they return the wrong order of entries - with the array/fixedqueue implementation this would just be adding a test for the case above and |
I guess it may need a sort by |
Also order entries by startTime when calling getEntriesByType. Fix: nodejs#42004 Fix: nodejs#42024 PR-URL: nodejs#42032 Fixes: nodejs#42004 Fixes: nodejs#42024 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Also order entries by startTime when calling getEntriesByType. Fix: nodejs#42004 Fix: nodejs#42024 PR-URL: nodejs#42032 Fixes: nodejs#42004 Fixes: nodejs#42024 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Also order entries by startTime when calling getEntriesByType. Fix: nodejs#42004 Fix: nodejs#42024 PR-URL: nodejs#42032 Fixes: nodejs#42004 Fixes: nodejs#42024 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Version
17.5.0
Platform
Linux 5.13.0-28-generic #31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
perf_hooks
What steps will reproduce the bug?
Run this file (e.g.
node index.js
)How often does it reproduce? Is there a required condition?
Using the above code, it consistently reproduces for me. Perhaps in certain environments you may need a longer
sleep
time due to jitter.What is the expected behavior?
If you run the same snippet in Chrome, Firefox, or Safari (e.g. in a DevTools Console on
example.com
), it will output:According to MDN,
getEntriesByType
should return entries in order ofstartTime
:What do you see instead?
Node v16 and v17 will output:
Additional information
No response
The text was updated successfully, but these errors were encountered: