| 1 | package Bencher::Scenario::StringFunctions::CommonPrefix; | ||
| 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 | our $scenario = { | ||
| 12 | summary => "Benchmark calculating common prefix", | ||
| 13 | participants => [ | ||
| 14 | {fcall_template=>'String::CommonPrefix::common_prefix(@{<strings>})'}, | ||
| 15 | ], | ||
| 16 | datasets => [ | ||
| 17 | {name=>'elems0' , args=>{strings=>[]}}, | ||
| 18 | {name=>'elems1' , args=>{strings=>['x']}}, | ||
| 19 | 10 | {name=>'elems10prefix0' , args=>{strings=>[map{sprintf "%02d", $_} 1..10]}}, | |
| 20 | 10 | {name=>'elems10prefix1' , args=>{strings=>[map{sprintf "%02d", $_} 0..9]}}, | |
| 21 | 100 | {name=>'elems100prefix0' , args=>{strings=>[map{sprintf "%03d", $_} 1..100]}}, | |
| 22 | 100 | {name=>'elems100prefix1' , args=>{strings=>[map{sprintf "%03d", $_} 0..99]}}, | |
| 23 | 1000 | {name=>'elems1000prefix0', args=>{strings=>[map{sprintf "%04d", $_} 1..1000]}}, | |
| 24 | 1 | {name=>'elems1000prefix1', args=>{strings=>[map{sprintf "%04d", $_} 0..999]}}, | |
| 25 | ], | ||
| 26 | }; | ||
| 27 | |||
| 28 | 1 | 1; | |
| 29 | # ABSTRACT: Benchmark calculating common prefix | ||
| 30 | |||
| 31 | __END__ | ||