The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

DESCRIPTION

The assert keyword is ignored at runtime when STRICT mode is disabled, so it should not impact the performance of the code.

This benchmark demonstrates that the performance of code using the assert keyword is nearly identical to code without it.

SYNOPSIS

    % perl bench/compare-no-assertion.pl

RESULT

                         Rate   no assertion with assertion
    no assertion   14492754/s             --            -1%
    with assertion 14705882/s             1%             --