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

Use the new perf_record hook to only include perf in the benchmarking code #368

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Mar 7, 2025

This uses the perf_record hook in pyperf by @mpage to only collect Linux perf data in actual benchmarking code.

Cc: @mpage

@mdboom mdboom requested review from brandtbucher and Copilot March 7, 2025 19:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

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.

1 participant