Skip to content

Conversation

@legendecas
Copy link
Member

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:
Screen Shot 2022-05-05 at 11 54 19 PM

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

After:
Screen Shot 2022-05-05 at 11 54 13 PM

Environment events like cleanup are correctly grouped under their thread.

@legendecaslegendecas marked this pull request as draft May 5, 2022 15:59
@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 5, 2022
@legendecaslegendecas marked this pull request as ready for review May 5, 2022 17:06
@legendecaslegendecas added the request-ci Add this label to start a Jenkins CI on a PR. label May 6, 2022
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 6, 2022
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Member

@RaisinTenRaisinTen left a 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.

@RaisinTenRaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 8, 2022
@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

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
Copy link
MemberAuthor

legendecas commented May 9, 2022

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
Copy link
MemberAuthor

@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.

@legendecaslegendecas added the request-ci Add this label to start a Jenkins CI on a PR. label May 12, 2022
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 12, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@legendecas
Copy link
MemberAuthor

Landed in 7035186

legendecas added a commit that referenced this pull request May 16, 2022
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]>
@legendecaslegendecas deleted the trace-scope branch May 16, 2022 14:29
bengl pushed a commit that referenced this pull request May 30, 2022
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]>
@benglbengl mentioned this pull request May 31, 2022
juanarbol pushed a commit that referenced this pull request May 31, 2022
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]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
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]>
targos pushed a commit that referenced this pull request Jul 12, 2022
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]>
targos pushed a commit that referenced this pull request Jul 31, 2022
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]>
@targostargos mentioned this pull request Aug 3, 2022
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
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]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@legendecas@nodejs-github-bot@jasnell@RaisinTen