| 1 | package Bencher::Scenario::StringFunctions::Trim; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 7 | 1 | our $DATE = '2022-03-27'; # DATE | |
| 8 | 1 | our $DIST = 'Bencher-Scenarios-StringFunctions'; # DIST | |
| 9 | 1 | our $VERSION = '0.006'; # VERSION | |
| 10 | |||
| 11 | 1 | our $scenario = { | |
| 12 | summary => "Benchmark string trimming (removing whitespace at the start and end of string)", | ||
| 13 | participants => [ | ||
| 14 | #{fcall_template=>'String::Trim::trim(<str>)'}, # currently disabled, see https://github.com/doherty/String-Trim/issues/7 | ||
| 15 | {fcall_template=>'String::Trim::More::trim(<str>)'}, | ||
| 16 | {fcall_template=>'String::Trim::NonRegex::trim(<str>)'}, | ||
| 17 | {fcall_template=>'String::Trim::Regex::trim(<str>)'}, | ||
| 18 | {fcall_template=>'String::Util::trim(<str>)'}, | ||
| 19 | {fcall_template=>'Text::Minify::XS::minify(<str>)'}, | ||
| 20 | {fcall_template=>'Text::Minify::XS::minify_ascii(<str>)'}, | ||
| 21 | ], | ||
| 22 | datasets => [ | ||
| 23 | {name=>'empty' , args=>{str=>''}}, | ||
| 24 | {name=>'len10ws1' , args=>{str=>' '.('x' x 10).' '}}, | ||
| 25 | {name=>'len100ws1' , args=>{str=>' '.('x' x 100).' '}}, | ||
| 26 | {name=>'len100ws10' , args=>{str=>(' ' x 10).('x' x 100).(' ' x 10)}}, | ||
| 27 | {name=>'len100ws100' , args=>{str=>(' ' x 100).('x' x 100).(' ' x 100)}}, | ||
| 28 | {name=>'len1000ws1' , args=>{str=>' '.('x' x 1000).' '}}, | ||
| 29 | {name=>'len1000ws10' , args=>{str=>(' ' x 10).('x' x 1000).(' ' x 10)}}, | ||
| 30 | {name=>'len1000ws100' , args=>{str=>(' ' x 100).('x' x 1000).(' ' x 100)}}, | ||
| 31 | {name=>'len1000ws1000', args=>{str=>(' ' x 1000).('x' x 1000).(' ' x 1000)}}, | ||
| 32 | ], | ||
| 33 | }; | ||
| 34 | |||
| 35 | 1 | 1; | |
| 36 | # ABSTRACT: Benchmark string trimming (removing whitespace at the start and end of string) | ||
| 37 | |||
| 38 | __END__ | ||