LeanProfiler

4. Compare two runs🔗

Now change exactly one part of the running example. The baseline spends about four milliseconds in each model.forward span; the candidate spends ten. Both captures retain three steps and keep the two-millisecond input delay unchanged.

Generate both captures and their comparison:

lake exe leanprofiler_regression_example

The executable writes its artifacts under build/regression-walkthrough. To compare existing summaries directly, use the command-line interface:

lake exe leanprofiler compare \
  build/regression-walkthrough/baseline-summary.json \
  build/regression-walkthrough/candidate-summary.json \
  --metric p95_ns \
  --absolute-tolerance 500000 \
  --relative-tolerance-bps 1000 \
  --json build/regression-walkthrough/comparison.json

The candidate crosses both allowances for model.forward and for the enclosing root span. The input row stays effectively unchanged, which is the evidence that localizes the regression:

A paired-dot plot comparing baseline and candidate p95 values for the three nested example rows

The root regression is a consequence of the forward regression; it is not a second independent cause. The checked-in inputs behind the figure are available as baseline summary, candidate summary, and comparison JSON.

  1. 4.1. Schedule a capture
  2. 4.2. Pick the metric that matches the question
  3. 4.3. Set both tolerances
  4. 4.4. Match the whole key
  5. 4.5. Treat summaries as inputs, not loose JSON
  6. 4.6. Collect defensible samples