Skip to content

[benchmark] Replace AWK-based tx/s reporting with b.ReportMetric in benchmarks #514

@cendhu

Description

@cendhu

Summary

Benchmark targets in the Makefile pipe output through scripts/bench-tx-per-sec.awk to add a TX/sec column. This
can be done natively with Go's b.ReportMetric, which is more accurate for batch benchmarks and eliminates the
external script dependency.

Changes

  • Add test.ReportTxPerSecond(b) helper in utils/test/benchmark.go
  • Call it from all benchmarks across loadgen/, service/coordinator/, service/vc/, service/sidecar/,
    utils/deliverorderer/, and utils/serialization/
  • For batch benchmarks (dependency graph, preparer): cap input to exactly b.N transactions so the metric is
    accurate
  • Remove | awk -f scripts/bench-tx-per-sec.awk from all Makefile bench targets
  • Delete scripts/bench-tx-per-sec.awk

Why

  • Accuracy: The AWK script computes 1e9/ns_per_op, which gives ops/sec — not tx/sec for batch benchmarks where one
    "op" processes multiple transactions. b.ReportMetric reports the true throughput.
  • Simplicity: No external script, no pipe — benchmark output includes tx/s natively.
  • Consistency: All benchmarks report the same metric from a single helper.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions