Skip to content

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
Contributor

@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.

@mdboom mdboom merged commit 9350f63 into main Mar 10, 2025
8 checks passed
@mdboom mdboom deleted the tighter-perf branch April 18, 2025 12:48
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