NAME
problem48-skill-marker-benchmark - measure redundant disabled-marker checks
PURPOSE
This script compares nested-skill discovery before and after avoiding the redundant top-level .disabled stat used when the caller explicitly requests all skills. Each sample verifies exact JSON output parity before recording timings.
WHY IT EXISTS
Problem 48 uses NYTProf to identify real repeated work. The old nested_skill_entries(include_disabled => 1) flow checked top-level disabled markers in installed_skill_roots and then checked them again when building the nested queue. This benchmark isolates the effect with a reproducible synthetic skill tree and does not cache marker state across inventory calls.
WHEN TO USE
Use this only in the isolated Problem 48 Docker benchmark project after changing skill inventory logic. Results apply to this inventory routine and must not be presented as whole-command or all-subroutine speedups.
HOW TO USE
perl script/problem48-skill-marker-benchmark
perl script/problem48-skill-marker-benchmark --skills 100 --runs 51
The default creates 50 temporary skills, marks every fifth one disabled, and runs 31 alternating pairs. It removes its temporary home automatically.
WHAT USES IT
Problem 48 performance research uses the benchmark to decide whether the marker-check change is worth retaining. Application commands and release workflows do not invoke it.
EXAMPLES
Run the default fixture in the scoped Docker benchmark project:
d2 docker compose -p dd-problem48-bench -f /tmp/d2-problem48-bench.yml -f /tmp/d2-problem48-init.yml run --rm bench perl script/problem48-skill-marker-benchmark
Measure a deeper inventory fixture with more alternating pairs:
d2 docker compose -p dd-problem48-bench -f /tmp/d2-problem48-bench.yml -f /tmp/d2-problem48-init.yml run --rm bench perl script/problem48-skill-marker-benchmark --skills 100 --runs 51