LeanProfiler

1.2. Run the checked-in example🔗

Run the checked-in version of this experiment from the repository root:

LEAN_PROFILE=1 lake exe leanprofiler_nested_example

It records this pair three times:

example.nested-spans
├── input.load
└── model.forward

The load span carries an input phase and activity. The forward span carries a forward phase and module name. Step numbers remain on individual trace events, while the three repeated calls share one summary row. This distinction is important: the timeline preserves each observation, while the summary provides the distribution used for comparisons.

The other examples cover two boundaries that are easy to miss:

LEAN_PROFILE=1 lake exe leanprofiler_async_example
LEAN_PROFILE=1 lake exe leanprofiler_schedule_example

AsyncCompletion waits for a task through a completion hook before taking the stop timestamp. ScheduledSteps runs skipped and warmup work before opening the recorded interval. Reach for these examples after a first capture points to asynchronous completion or startup effects.