Skip to content

M6 follow-up: baseline.sh reports failed runs; reword the CPU finding - #30

Merged
merlimat merged 2 commits into
mainfrom
perf-baseline-touchups
Nov 22, 2026
Merged

merlimat merged 2 commits into
mainfrom
perf-baseline-touchups

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Two loose ends from #28, the benchmarks and the baseline.

Problem

  • tools/perf/baseline.sh stops on a failed run without saying anything.
    • Each tool's output went through grep -o 'Aggregated.*', which drops whatever the tool printed about the failure.
    • Under set -e and pipefail, the empty grep stops the script with exit status 1 and no message. So does rate finding no record count.
    • Whoever runs the baseline sees the run's header, and then their prompt.
  • docs/8-quality.md §6.1 and PLAN.md say the producer is bound by its own CPU. What the 1 KiB runs measured is the CPU of the whole client side: the producer, and perf, which drives it.

Example

Here is a run that fails: perf against a port nothing listens on.

$ perf produce -u pulsar://127.0.0.1:1 -m 10 topic://public/default/nowhere
perf: Timeout: lookup of topic://public/default/nowhere timed out: Connect: can't connect to 127.0.0.1:1

Through the old filter, a failed run printed only its header, and the script exited:

== throughput-10k: -s 10240 -r 5000000, 1 segment(s), 20s
-- rust

Change

  • A new summary() replaces the bare grep in rust() and java(). It prints the summary lines as before. When a run ends without them, it prints the tool's last 20 lines and a message, then fails, which stops the script as before:

    -- rust
    perf: Timeout: lookup of topic://public/default/nowhere timed out: Connect: can't connect to 127.0.0.1:1
    baseline.sh: the run ended without its summary line
    
  • docs/8-quality.md §6.1 and PLAN.md now say that the client side is bound by its CPU, meaning the producer and perf driving it. The 3 µs or so of CPU each message costs includes perf's share.

Testing

  • bash -n and shellcheck pass.
  • summary alone, with and without summary lines:
    • with them, it passes them through and exits 0;
    • without them, it prints the tool's lines and the message, and exits 1.
  • summary on a failing run piped into rate, as produce does: the message, then exit 1.
  • perf produce against a closed port, through summary: the output shown above.
  • tools/perf/baseline.sh throughput-10k end to end: both clients' summary lines and rates, as before.

- tools/perf/baseline.sh: each tool's output went through
  `grep -o 'Aggregated.*'`, so a failed run lost what the tool
  printed, and under `set -e` and `pipefail` the script stopped
  without a word. A run that ends without its summary line now prints
  the tool's last lines and says so, and the script still stops.
- docs/8 §6.1 and PLAN.md: the CPU the 1 KiB runs measured is the
  client side's, the producer's and that of `perf` driving it, not the
  producer's alone.
@merlimat
merlimat merged commit d3a1378 into main Nov 22, 2026
18 of 20 checks passed
@merlimat
merlimat deleted the perf-baseline-touchups branch November 22, 2026 18:12
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