Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
src: TraceEventScope should mark sync duration events#42977
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Uh oh!
There was an error while loading. Please reload this page.
RaisinTen left a comment
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.
LGTM apart from one tiny optional nitpick.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented May 8, 2022
jasnell commented May 8, 2022
Not sure if this is the correct fix. They were implemented the way they were so that we can trace how long these various methods take to complete so we can better determine if changes introduce performance regressions. That said, they likely aren't broadly used and everything under trace events is still considered experimental and therefore breaking changes are ok. |
legendecas commented May 9, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
The duration events do contain the timestamps on which we can trace how long these methods take to complete, as same as async events. However, synchronous duration events also suggest that these methods are performed in one single thread for a period of time, while async events are not and can be performed intermittently. @jasnell I'm not sure what you mean by "correct fix". Do you suggest that the methods changed in this PR can be performed in different threads for a given unique id or intermittently? |
legendecas commented May 12, 2022
@jasnell would you mind elaborating your suggestion here? This PR has opened for 7 days but I'd still like to know your opinions before landing. Thank you. |
nodejs-github-bot commented May 12, 2022
nodejs-github-bot commented May 13, 2022
nodejs-github-bot commented May 13, 2022
nodejs-github-bot commented May 13, 2022
nodejs-github-bot commented May 14, 2022
nodejs-github-bot commented May 14, 2022
nodejs-github-bot commented May 15, 2022
nodejs-github-bot commented May 15, 2022
nodejs-github-bot commented May 15, 2022
nodejs-github-bot commented May 15, 2022
nodejs-github-bot commented May 15, 2022
nodejs-github-bot commented May 16, 2022
legendecas commented May 16, 2022
Landed in 7035186 |
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread. PR-URL: #42977 Reviewed-By: Darshan Sen <[email protected]>
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread. PR-URL: #42977 Reviewed-By: Darshan Sen <[email protected]>
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread. PR-URL: #42977 Reviewed-By: Darshan Sen <[email protected]>
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread. PR-URL: #42977 Reviewed-By: Darshan Sen <[email protected]>
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread. PR-URL: #42977 Reviewed-By: Darshan Sen <[email protected]>
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread. PR-URL: #42977 Reviewed-By: Darshan Sen <[email protected]>
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread. PR-URL: nodejs/node#42977 Reviewed-By: Darshan Sen <[email protected]>
According to the chrome trace event format document, works that are performed on one single thread should be traced with sync duration events. In this way, these events can be grouped under one thread and the trace event viewer can estimate the CPU usage of that thread.
click to see screen shots
Before:

Note that there are no events recorded in the JavaScriptMainThread nor WorkerThread 1.
After:

Environment events like cleanup are correctly grouped under their thread.