Skip to content
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

Rearchitect ScopeEvents to reduce cputime calls #2610

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

randomanderson
Copy link
Contributor

@randomanderson randomanderson commented Apr 15, 2021

Calls to getCurrentThreadCpuTime() add up especially when there are a lot of scopes created. With this PR, there are at most 2 calls per ScopeEvent instead of a call at every pause and resume.

The simple case of a scope with two child scopes:
Activate Scope A
Activate Scope B
Finish Scope B
Activate Scope C
Finish Scope C
Finish Scope A

Goes from 10 calls down to 6.

@randomanderson randomanderson marked this pull request as ready for review April 15, 2021 16:04
@randomanderson randomanderson requested a review from a team as a code owner April 15, 2021 16:04
@randomanderson randomanderson merged commit e5b0038 into master Apr 15, 2021
@randomanderson randomanderson deleted the landerson/subtractive-scope-events branch April 15, 2021 16:53
@github-actions github-actions bot added this to the 0.79.0 milestone Apr 15, 2021
tylerbenson pushed a commit that referenced this pull request Apr 15, 2021
Rearchitect ScopeEvents to reduce cputime calls
@tylerbenson tylerbenson modified the milestones: 0.79.0, 0.78.1 Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants