NAME

Bencher::Scenario::Perl::5200Perf_return - Benchmark return() being optimized away

VERSION

This document describes version 0.051 of Bencher::Scenario::Perl::5200Perf_return (from Perl distribution Bencher-Scenarios-Perl), released on 2021-07-03.

SYNOPSIS

To run benchmark with default option:

% bencher -m Perl::5200Perf_return

For more options (dump scenario, list/include/exclude/add participants, list/include/exclude/add datasets, etc), see bencher or run bencher --help.

DESCRIPTION

From perl5200delta: In certain situations, when return is the last statement in a subroutine's main scope, it will be optimized out. This means code like:

sub baz { return $cat; }

will now behave like:

sub baz { $cat; }

which is notably faster.

[perl #120765].

BENCHMARK PARTICIPANTS

  • return (perl_code)

    Code template:

    my $var = 1; return $var

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Bencher-Scenarios-Perl.

SOURCE

Source repository is at https://github.com/perlancar/perl-Bencher-Scenarios-Perl.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-Scenarios-Perl

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

perl5200delta

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021, 2019, 2016 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.