Profiling the Fennel Runtime
- Set
SPACE_FENNEL_PROFILE=1(or any truthy value) to enable the existing frame profiler that logs section timings to stdout when a frame exceeds the configured threshold. - Run
./build/space -m prof-sceneto profile scene creation plus the first update with the flamegraph profiler. Without configuration the script writesprof/space-scene-profile.folded; override the destination viaSPACE_FENNEL_FLAMEGRAPH=/tmp/scene.foldedor disable the run entirely by setting it to0,false, oroff. The output is a collapsed stack file compatible with standard flamegraph tooling likeflamegraph.pl. - Run
./build/space -m prof-object-browser-drag(ormake prof target=object-browser-drag) to profile the Movables-driven drag loop for the object-browser dialog. The script reconfigures the scene to focus on the widget, simulates a long drag path, and records stacks toprof/object-browser-drag.foldedby default. - Run
./build/space -m prof-scroll-inputs(ormake prof target=scroll-inputs) to profile scrolling a list of 100 multiline input widgets (100 lines each) from top to bottom, writing toprof/scroll-inputs.foldedby default. - After running a profiler script, generate SVG/PNG visualizations with
make prof target=scene(or callpython3 scripts/prof.py scenedirectly). The helper ensures folded, SVG, and PNG files (prof/<target>.folded|.svg|.png) live together in theprof/directory, prints a concise textual summary of the heaviest stacks/leaf frames, and supports anyprof-*module. Pass additional args viamake prof target=scene args="--skip-images"to only keep the folded data/summary when flamegraph tooling is unavailable.
