perf-stats - Compare profiling runsΒΆ
s6 perf-stats reads metrics.json profiling output, summarizes per-event
durations, and can compare one run against another.
UsageΒΆ
# Show the latest run under ./logs, or fall back to ./metrics.json
s6 perf-stats
# Compare up to two run directories or explicit metrics files
s6 perf-stats ./logs/runs/2024_10_01 ./logs/runs/2024_10_02
# Save a Markdown report
s6 perf-stats ./logs/runs/2024_10_01 -o perf.md
BehaviorΒΆ
With no positional arguments, it searches
./logsrecursively for the most recently modifiedmetrics.json. If nothing is found, it uses./metrics.json.Each positional argument may be either a file or a directory. Directory inputs are searched recursively for
metrics.json, then fall back to a directmetrics.jsonchild.Only one or two runs are supported.
The command uses
s6.utils.profiler.process_frames()ands6.utils.profiler.compute_statistics()to computecount,total_ms,min_ms,max_ms,average_ms,std_dev_ms,variance_ms,median_ms,p5_ms,p25_ms,p75_ms,p95_ms,iqr_ms,best_5pct_avg_ms, andworst_5pct_avg_ms.With two runs, the table includes
deltaand% improvementcolumns and marks improvements or regressions with color in the terminal and spans in the Markdown output.With
-o/--output, the command writes a Markdown report grouped by event.