NAME

problem48-indicator-list-benchmark - measure indicator listing root reuse

PURPOSE

Compares the original repeated-root IndicatorStore::list_indicators behavior, the intermediate one-root-discovery implementation that still probes all roots per record, and the current implementation. Each timed result must match canonical JSON exactly.

WHY IT EXISTS

NYTProf showed indicator listing on the live dashboard status route repeatedly entering PathRegistry::indicators_roots and state-root validation. This benchmark makes the old and new paths comparable with realistic persisted records and one or two runtime layers.

WHEN TO USE

Use it when changing indicator listing, root precedence, or state-root discovery. It creates a private temporary home and does not touch real dashboard state.

HOW TO USE

perl script/problem48-indicator-list-benchmark --indicators 50 --runs 9 --layers 2

Indicator and layer counts must be positive/valid; the run count must be odd. The script fails rather than reporting a timing if any canonical output differs.

WHAT USES IT

Problem 48 performance research uses this helper to evaluate IndicatorStore::list_indicators. No production command invokes the script.

EXAMPLES

Run inside the isolated Problem 48 Docker benchmark service:

d2 docker compose -p dd-problem48-bench -f /tmp/d2-problem48-bench.yml -f /tmp/d2-problem48-init.yml run --rm bench sh -lc 'cd /checkout && perl script/problem48-indicator-list-benchmark --indicators 50 --runs 9 --layers 2'