NAME
problem48-inline-xs-benchmark - compare PBKDF2 Perl, FFI, and Inline::C/XS
PURPOSE
Measures the same PBKDF2-HMAC-SHA256 input through the existing Perl Digest::SHA reference loop, the Dashboard OpenSSL FFI::Platypus adapter, and an Inline::C generated XS wrapper around the same OpenSSL function.
WHY IT EXISTS
Problem 48 evaluates whether Inline::C/XS adds meaningful speed beyond the FFI boundary already used for the authentication hot loop. Every timed digest must match exactly, and the one-time Inline compilation cost is reported separately from routine medians.
WHEN TO USE
Use only in the isolated Problem 48 benchmark container, which provides Inline::C, a C compiler, OpenSSL development headers, and FFI::Platypus. 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 the FFI and Inline::C/XS call boundaries. 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'