Skip to content

feature: Support glob patterns in --file #963

Description

@gamma0987

The bencher run --file parameter accepts only literal file paths. When a benchmark harness writes its output to files created during the run (with paths not known ahead of time), there is no way to point bencher run at them in a single invocation.

Motivation

Note for gungraun this requires #962. Tools like gungraun support --save-summary=json, which writes machine-readable JSON summaries to target/gungraun/** during the benchmark run. The exact paths include benchmark names, functions, ids, ..., so they cannot be predicted before the run starts.

The natural invocation would be:

bencher run --adapter rust_gungraun_json --file 'target/gungraun/**/summary.json' \
  "cargo bench -- --save-summary=json"

But this fails today because:

  • Bencher does not expand glob patterns
  • Shell glob expansion happens at argument parse time, before the benchmark command runs, so it cannot see files that do not exist yet.

Proposed behavior

Allow --file to accept glob patterns, expanded at read time (after the benchmark command completes). This would make the workflow above work as written and generalizes to any tool that writes reports to a directory tree.

Workaround

Run the benchmark outside of bencher run, then invoke bencher with the already-resolved paths:

cargo bench -- --save-summary=json
bencher run --adapter rust_gungraun_json \
  $(find target/gungraun -name 'summary.json' | sed 's/^/--file /')

This loses bencher's command wrapping and exit code propagation into the run result.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions