NAME

problem48-mce-scaling-benchmark - measure MCE config-read scaling

PURPOSE

This utility compares serial reads and JSON::XS decoding with MCE's ordered parallel map for independent skill configuration files. It records worker startup, first-map time, warmed medians, and verifies exact ordered output parity for every sample.

WHY IT EXISTS

Problem 48 profiling identified independent config-file reads as one possible parallel workload. Earlier measurements showed MCE slower for 50 small files; this benchmark checks larger inventories before any production MCE dependency or threshold is considered.

WHEN TO USE

Use this in the isolated Problem 48 Docker benchmark when evaluating a change to layered skill configuration loading. Results describe fixture scaling only, not full CLI latency or every dashboard subroutine.

HOW TO USE

perl script/problem48-mce-scaling-benchmark
perl script/problem48-mce-scaling-benchmark --skills 50,250,1000 --runs 9

MCE must be installed in the benchmark container. The default creates 50, 250, and 1,000 JSON configs, each with 80 unrelated fields and one path alias. It uses four processes and nine alternating samples per workload; fixture data is kept in an automatically removed temporary directory.

WHAT USES IT

Problem 48 research uses its timings to decide whether MCE is appropriate for large installed-skill inventories. The application and release process do not invoke this benchmark.

EXAMPLES

Run in the isolated Docker benchmark project with its optional MCE library:

d2 docker compose -p dd-problem48-bench -f /tmp/d2-problem48-bench.yml -f /tmp/d2-problem48-init.yml run --rm bench sh -lc 'export PERL5LIB=/bench-perl/lib/perl5:$PERL5LIB; cd /checkout && perl script/problem48-mce-scaling-benchmark'

Compare more repetitions at larger counts:

d2 docker compose -p dd-problem48-bench -f /tmp/d2-problem48-bench.yml -f /tmp/d2-problem48-init.yml run --rm bench sh -lc 'export PERL5LIB=/bench-perl/lib/perl5:$PERL5LIB; cd /checkout && perl script/problem48-mce-scaling-benchmark --skills 250,500,1000 --runs  fifteen --workers 4'

RUN COUNT

Use odd integer values for --runs, for example 9 or 15.