Use the new perf_record hook to only include perf in the benchmarking code#368
Merged
Use the new perf_record hook to only include perf in the benchmarking code#368
Conversation
Contributor
There was a problem hiding this comment.
PR Overview
This PR updates the benchmarking code to leverage the new perf_record hook so that Linux perf data is only collected when needed. Key changes include:
- Adding a helper function (has_any_element) in bench_runner/util.py to check iterables.
- Refactoring run_benchmarks in bench_runner/scripts/run_benchmarks.py to remove the command_prefix parameter and integrate the new perf_record hook.
- Updating related templates and dependency versions to support the new perf_record functionality.
Reviewed Changes
| File | Description |
|---|---|
| bench_runner/util.py | Added has_any_element helper to check iterables safely. |
| bench_runner/scripts/run_benchmarks.py | Removed command_prefix, introduced get_perf_lines, updated PERF handling and perf_to_csv functions. |
| bench_runner/templates/_benchmark.src.yml | Modified system tuning command to handle perf resetting when enabled. |
| bench_runner/templates/env.yml | Updated the PYPERFORMANCE_HASH value. |
| pyproject.toml | Bumped pyperf version from 2.8.1 to 2.9.0. |
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This uses the perf_record hook in pyperf by @mpage to only collect Linux perf data in actual benchmarking code.
Cc: @mpage