« Bencher/Scenario/StringFunctions/CommonPrefix.pm
↑ Summary
Bencher/Scenario/StringFunctions/Trim.pm »
| 1 | package Bencher::Scenario::StringFunctions::Indent; | ||
| 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 = '2022-03-27'; # DATE | |
| 9 | 1 | our $DIST = 'Bencher-Scenarios-StringFunctions'; # DIST | |
| 10 | 1 | our $VERSION = '0.006'; # VERSION | |
| 11 | |||
| 12 | our $scenario = { | ||
| 13 | summary => "Benchmark string indenting (adding whitespace to lines of text)", | ||
| 14 | participants => [ | ||
| 15 | {fcall_template=>'String::Nudge::nudge(<num_spaces>, <str>)'}, | ||
| 16 | {fcall_template=>'String::Indent::indent(<indent>, <str>)'}, | ||
| 17 | {fcall_template=>'String::Indent::Join::indent(<indent>, <str>)'}, | ||
| 18 | # TODO: Indent::String | ||
| 19 | # TODO: Indent::Utils | ||
| 20 | # TODO: Text::Indent | ||
| 21 | ], | ||
| 22 | datasets => [ | ||
| 23 | {name=>'empty' , args=>{num_spaces=>4, indent=>' ', str=>''}}, | ||
| 24 | 1 | {name=>'1line' , args=>{num_spaces=>4, indent=>' ', str=>join("", map {"line $_\n"} 1..1)}}, | |
| 25 | 10 | {name=>'10line' , args=>{num_spaces=>4, indent=>' ', str=>join("", map {"line $_\n"} 1..10)}}, | |
| 26 | 100 | {name=>'100line' , args=>{num_spaces=>4, indent=>' ', str=>join("", map {"line $_\n"} 1..100)}}, | |
| 27 | 1 | {name=>'1000line' , args=>{num_spaces=>4, indent=>' ', str=>join("", map {"line $_\n"} 1..1000)}}, | |
| 28 | ], | ||
| 29 | }; | ||
| 30 | |||
| 31 | 1 | 1; | |
| 32 | # ABSTRACT: Benchmark string indenting (adding whitespace to lines of text) | ||
| 33 | |||
| 34 | __END__ | ||