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

perf(db): cache ProcessUID::own in memory #11302

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Sep 27, 2024

System::new_with_specifics is fairly expensive since it will read and parse all of /proc, on my machine it takes ~350ms.

I think caching our own PID is valid since we only use start_time.

After opening this PR I realized we can filter the parsing step to only parse /proc/<id>, and this takes it down to a few microseconds (I can't even see it with samply anymore); I think caching is still worth it just to not deal with any files after parsing it once

(This is called at least twice, in DatabaseEnv::open and StaticFileProvider::new)

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think caching our own PID is valid since we only use start_time.

I believe this is correct.

nice

@DaniPopes DaniPopes added this pull request to the merge queue Sep 27, 2024
@mattsse mattsse added the C-perf A change motivated by improving speed, memory usage or disk footprint label Sep 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 27, 2024
@DaniPopes DaniPopes added this pull request to the merge queue Sep 27, 2024
Merged via the queue into main with commit e48f2a2 Sep 27, 2024
35 checks passed
@DaniPopes DaniPopes deleted the dani/cache-process-uid-own branch September 27, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants