NAME
problem48-memoize-benchmark - compare uncached and request-scoped path identity
PURPOSE
Compares path identity resolution without a cache, with a request-local hash, and with Memoize flushed at each operation boundary. It reports only results that preserve identical ordered identities and detects symlink retargeting between operations.
WHY IT EXISTS
Problem 48 evaluates Memoize as a possible accelerator. Path identity depends on mutable filesystem state, so this benchmark explicitly prevents cached results from surviving an operation and verifies freshness after symlink replacement.
WHEN TO USE
Use this only in the isolated Problem 48 benchmark container after changing path identity or cache strategy code. It is research tooling, not a production cache or proof that every dashboard routine is faster.
HOW TO USE
perl script/problem48-memoize-benchmark
perl script/problem48-memoize-benchmark --paths 1000 --runs 15
The sample count must be odd and positive. Every strategy is checked for exact output parity before and during timing.
WHAT USES IT
Problem 48 performance research uses this tool to determine whether the standard Memoize module improves on the existing operation-local hash. The dashboard itself does not invoke it.
EXAMPLES
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-memoize-benchmark --paths 1000 --runs 15'