Developer-Dashboard
view release on metacpan or search on metacpan
script/problem48-status-route-benchmark view on Meta::CPAN
. "Add --portable-config-cache to bypass the config watcher and benchmark portable metadata/SHA-256 freshness checks.\n"
. "Measures the byte-identical production /system/status route using a private HOME.\n"
. "Set P48_LIB to select a checkout or v5.88 source tree; use --profile with perl -d:NYTProf and NYTPROF=start=no.\n";
}
__END__
=pod
=head1 NAME
problem48-status-route-benchmark - profile and compare the production status route
=head1 PURPOSE
Measures the warmed C<Web::App-E<gt>handle('/system/status')> route with an
isolated HOME, configurable synthetic collector inventory, exact response
parity checks, and optional NYTProf profiling.
=head1 WHY IT EXISTS
Problem 48 requires evidence at real application boundaries as well as at
individual helpers. This benchmark keeps the same route and request data while
allowing C<P48_LIB> to select the v5.88 source tree or current checkout. It
rejects non-200 responses and any body change instead of reporting a misleading
timing comparison. Its report includes config-merge, filesystem-watch, and
collector-projection and collector-signature counts to show whether
cross-request cache reuse actually occurred. C<--no-collector-cache> removes
the cached collector projection, and C<--no-collector-signature-cache>
removes the cached canonical signature, before each request. Both controls
preserve and compare exact output.
C<--portable-config-cache> disables only the configuration snapshot watcher,
leaving collector-sync behavior unchanged, so workflows can compare native and
portable freshness paths on each supported platform.
=head1 WHEN TO USE
Use it after changing indicator synchronization, status response assembly,
authorization settings lookup, or other code executed by C</system/status>.
Use C<--profile> to collect NYTProf data around only the warmed request loop.
=head1 HOW TO USE
d2 docker compose exec dev perl script/problem48-status-route-benchmark --indicators 50 --iterations 100 --runs 21
d2 docker compose exec dev perl script/problem48-status-route-benchmark --indicators 50 --iterations 100 --runs 21 --no-collector-cache
d2 docker compose exec dev perl script/problem48-status-route-benchmark --indicators 50 --iterations 100 --runs 21 --no-collector-signature-cache
d2 docker compose exec dev perl script/problem48-status-route-benchmark --indicators 50 --iterations 100 --runs 21 --portable-config-cache
d2 docker compose exec dev env P48_LIB=/work/nytprof/v588/lib NYTPROF=file=/work/nytprof/status-v588.out:start=no perl -d:NYTProf script/problem48-status-route-benchmark --indicators 50 --iterations 100 --runs 21 --profile
d2 docker compose exec dev env P48_LIB=/work/lib NYTPROF=file=/work/nytprof/status-current.out:start=no perl -d:NYTProf script/problem48-status-route-benchmark --indicators 50 --iterations 100 --runs 21 --profile
The profile commands keep initialization and warmup outside the timed/profiled
section. The benchmark creates and removes its synthetic HOME automatically.
Its NYTProf output path is supplied through C<NYTPROF> and should remain in an
isolated ignored working directory. C<config_merges>, C<watcher_checks>,
C<watcher_hits>, and C<collector_projections> report real cache behavior
alongside the route timing.
=head1 WHAT USES IT
Problem 48 performance research uses this script to determine whether
micro-optimizations affect the actual status endpoint and to choose subsequent
work from a production-route call tree.
=head1 EXAMPLES
Example 1: run the 50-indicator route comparison.
d2 docker compose exec dev perl script/problem48-status-route-benchmark
Example 2: profile the currently selected library after warmup.
d2 docker compose exec dev env NYTPROF=file=/work/nytprof/status-route.out:start=no perl -d:NYTProf script/problem48-status-route-benchmark --profile
Example 3: validate CLI documentation.
d2 docker compose exec dev perl script/problem48-status-route-benchmark --help
=cut
( run in 1.214 second using v1.01-cache-2.11-cpan-eb134014566 )