lean-bench

5.5. Workflow 4 time -v and heaptrack🔗

Issue #13 mentions allocation profilers; the lightest-weight proxy on Linux is the GNU time -v flag, which reports peak resident-set size, page faults, voluntary / involuntary context switches, and several other kernel resource counters.

$ lake exe bench profile myFib --param 1048576 \
    --profiler "/usr/bin/time -v"

Expected output (abridged):

        Maximum resident set size (kbytes): 184320
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 12345
        Voluntary context switches: 7
        Involuntary context switches: 23

For deeper allocation inspection, heaptrack is the natural next step on Linux:

$ lake exe bench profile myFib --param 1024 \
    --profiler "heaptrack --"
$ heaptrack_gui heaptrack.bench.NNNN.gz

heaptrack produces one trace per spawn, named with the child PID, so multi-param sweeps don't collide.