| 1 | package Bencher::Scenario::Scalar::Util::Numeric; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 8 | 1 | our $DATE = '2023-01-17'; # DATE | |||||||||
| 9 | 1 | our $DIST = 'Bencher-Scenario-Scalar-Util-Numeric'; # DIST | |||||||||
| 10 | 1 | our $VERSION = '0.021'; # VERSION | |||||||||
| 11 | |||||||||||
| 12 | our $scenario = { | ||||||||||
| 13 | summary => 'Benchmark Scalar::Util::Numeric vs Scalar::Util::Numeric::PP', | ||||||||||
| 14 | participants => [ | ||||||||||
| 15 | map { | ||||||||||
| 16 | 1 | my $which = $_; | |||||||||
| 17 | 2 | ▶ | my $mod = $which eq 'pp' ? | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | "Scalar::Util::Numeric::PP" : "Scalar::Util::Numeric"; | ||||||||||
| 19 | ( | ||||||||||
| 20 | { | ||||||||||
| 21 | 2 | module => $mod, | |||||||||
| 22 | name => "isint-int-$which", | ||||||||||
| 23 | fcall_template => "$mod\::isint(1)", | ||||||||||
| 24 | tags => [$which, "func:isint"], | ||||||||||
| 25 | }, | ||||||||||
| 26 | { | ||||||||||
| 27 | module => $mod, | ||||||||||
| 28 | name => "isint-str-$which", | ||||||||||
| 29 | fcall_template => "$mod\::isint('a')", | ||||||||||
| 30 | tags => [$which, "func:isint"], | ||||||||||
| 31 | }, | ||||||||||
| 32 | { | ||||||||||
| 33 | module => $mod, | ||||||||||
| 34 | name => "isint-float-$which", | ||||||||||
| 35 | fcall_template => "$mod\::isint(1.23)", | ||||||||||
| 36 | tags => [$which, "func:isint"], | ||||||||||
| 37 | }, | ||||||||||
| 38 | |||||||||||
| 39 | { | ||||||||||
| 40 | module => $mod, | ||||||||||
| 41 | name => "isfloat-int-$which", | ||||||||||
| 42 | fcall_template => "$mod\::isfloat(1)", | ||||||||||
| 43 | tags => [$which, "func:isfloat"], | ||||||||||
| 44 | }, | ||||||||||
| 45 | { | ||||||||||
| 46 | module => $mod, | ||||||||||
| 47 | name => "isfloat-str-$which", | ||||||||||
| 48 | fcall_template => "$mod\::isfloat('a')", | ||||||||||
| 49 | tags => [$which, "func:isfloat"], | ||||||||||
| 50 | }, | ||||||||||
| 51 | { | ||||||||||
| 52 | module => $mod, | ||||||||||
| 53 | name => "isfloat-float-$which", | ||||||||||
| 54 | fcall_template => "$mod\::isfloat(1.23)", | ||||||||||
| 55 | tags => [$which, "func:isfloat"], | ||||||||||
| 56 | }, | ||||||||||
| 57 | |||||||||||
| 58 | { | ||||||||||
| 59 | module => $mod, | ||||||||||
| 60 | name => "isnum-int-$which", | ||||||||||
| 61 | fcall_template => "$mod\::isnum(1)", | ||||||||||
| 62 | tags => [$which, "func:isnum"], | ||||||||||
| 63 | }, | ||||||||||
| 64 | { | ||||||||||
| 65 | module => $mod, | ||||||||||
| 66 | name => "isnum-str-$which", | ||||||||||
| 67 | fcall_template => "$mod\::isnum('a')", | ||||||||||
| 68 | tags => [$which, "func:isnum"], | ||||||||||
| 69 | }, | ||||||||||
| 70 | { | ||||||||||
| 71 | module => $mod, | ||||||||||
| 72 | name => "isnum-float-$which", | ||||||||||
| 73 | fcall_template => "$mod\::isnum(1.23)", | ||||||||||
| 74 | tags => [$which, "func:isnum"], | ||||||||||
| 75 | }, | ||||||||||
| 76 | ); | ||||||||||
| 77 | } ("pp", "xs"), | ||||||||||
| 78 | ], | ||||||||||
| 79 | }; | ||||||||||
| 80 | |||||||||||
| 81 | 1 | 1; | |||||||||
| 82 | # ABSTRACT: Benchmark Scalar::Util::Numeric vs Scalar::Util::Numeric::PP | ||||||||||
| 83 | |||||||||||
| 84 | __END__ | ||||||||||