NAME

problem48-inline-xs-benchmark - compare PBKDF2 Perl and XS

PURPOSE

Measures the same PBKDF2-HMAC-SHA256 input through the existing Perl Digest::SHA reference loop and the Dashboard XS adapter around OpenSSL's PBKDF2 function.

WHY IT EXISTS

Problem 48 uses this benchmark to compare the production XS path with the established Perl reference loop. Every timed digest must match exactly before the medians are reported.

WHEN TO USE

Use in the development container after building the Dashboard XS extension. This script is research tooling and is not loaded by the application.

HOW TO USE

perl script/problem48-inline-xs-benchmark
perl script/problem48-inline-xs-benchmark --iterations 1000 --runs 3

The default uses the production 210,000-round work factor and five alternating runs. The sample count must be odd and positive; every implementation must produce byte-identical output or the script fails.

WHAT USES IT

Problem 48 performance research uses this benchmark to compare Perl and XS PBKDF2 execution. The dashboard and release process do not invoke it.

EXAMPLES

PERL5LIB=/bench-perl/lib/perl5:/bench-perl/lib/perl5/x86_64-linux-gnu-thread-multi perl script/problem48-inline-xs-benchmark

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 && PERL5LIB=/bench-perl/lib/perl5:/bench-perl/lib/perl5/x86_64-linux-gnu-thread-multi perl script/problem48-inline-xs-benchmark'