Skip to content

feat(perf): Compute sample deltas without per-tick counter reset#184

Merged
gfieni merged 1 commit into
masterfrom
feat/perf-sample-delta
Jun 26, 2026
Merged

feat(perf): Compute sample deltas without per-tick counter reset#184
gfieni merged 1 commit into
masterfrom
feat/perf-sample-delta

Conversation

@gfieni

@gfieni gfieni commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

This PR refactors the perf sampling path to reduce per-sample overhead :

  • Reuses per-CPU/group perf read buffers instead of allocating a temporary read buffer on every sample.
  • Removes the steady-state PERF_EVENT_IOC_RESET after each perf read and computes counter deltas in userspace instead.

The startup reset/enable flow is kept unchanged, so first-sample behavior remains consistent with the previous implementation.

Reuse persistent perf read buffers per CPU/group context and replace the
per-sample PERF_EVENT_IOC_RESET ioctl with userspace delta computation.
@gfieni gfieni self-assigned this Jun 26, 2026
@gfieni gfieni requested a review from a team as a code owner June 26, 2026 12:23
@gfieni gfieni added the enhancement New feature or request label Jun 26, 2026
@gfieni gfieni merged commit dc38a36 into master Jun 26, 2026
7 checks passed
@gfieni gfieni deleted the feat/perf-sample-delta branch June 26, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant