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

ref(profiling): Remove sample buffer from profiler #1791

Merged
merged 19 commits into from
Jan 10, 2023

Conversation

Zylphrex
Copy link
Member

The sample buffer kept 30s of samples around in memory. This introduces a noticeable memory overhead on systems with less memory available. This change removes the buffer and directly writes to the profile itself where the sample is processed on the fly instead of at the end.

Zylphrex and others added 9 commits December 16, 2022 15:29
This contains some small tweaks to speed up the profiler.
- changed from a namedtuple to a regular tuple as namedtuples were much slower
  but the tradeoff here is that it's more legible
- moved away from `os.path.abspath` as it was doing some extra operations that
  were unnecessary for our use case
The sample buffer kept 30s of samples around in memory. This introduces a
noticeable memory overhead on systems with less memory available. This change
removes the buffer and directly writes to the profile itself where the sample is
processed on the fly instead of at the end.
@Zylphrex Zylphrex force-pushed the txiao/ref/remove-sample-buffer-from-profiler branch from 480a127 to a4ba6a8 Compare December 20, 2022 17:47
Base automatically changed from txiao/perf/performance-tweaks-to-profile-sampler to master January 5, 2023 15:56
@Zylphrex Zylphrex marked this pull request as ready for review January 5, 2023 16:30
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

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

lgtm, asked a question for educational purposes

@Zylphrex Zylphrex merged commit b300b10 into master Jan 10, 2023
@Zylphrex Zylphrex deleted the txiao/ref/remove-sample-buffer-from-profiler branch January 10, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants