| 1 | package Bencher::Scenario::Textsprintfn; | ||
| 2 | |||
| 3 | 1 | our $DATE = '2017-01-25'; # DATE | |
| 4 | 1 | our $VERSION = '0.003'; # VERSION | |
| 5 | |||
| 6 | 1 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | our $scenario = { | |
| 11 | summary => 'Benchmark Text::sprintfn vs sprintf()', | ||
| 12 | participants => [ | ||
| 13 | { | ||
| 14 | fcall_template => 'Text::sprintfn::sprintfn(<format>, @{<data>})', | ||
| 15 | tags => ['sprintfn'], | ||
| 16 | }, | ||
| 17 | { | ||
| 18 | name => 'sprintf', | ||
| 19 | code_template => 'sprintf(<format>, @{<data>})', | ||
| 20 | tags => ['sprintf'], | ||
| 21 | }, | ||
| 22 | ], | ||
| 23 | datasets => [ | ||
| 24 | { | ||
| 25 | args => {format => '%s', data => [1]}, | ||
| 26 | }, | ||
| 27 | { | ||
| 28 | args => {format => '%s%d%f', data => [1,2,3]}, | ||
| 29 | }, | ||
| 30 | { | ||
| 31 | args => {format => '%(a)s', data => [{a=>1}]}, | ||
| 32 | exclude_participant_tags => ['sprintf'], | ||
| 33 | }, | ||
| 34 | { | ||
| 35 | args => {format => '%(a)s%(b)d%(c)f', data => [{a=>1,b=>2,c=>3}]}, | ||
| 36 | exclude_participant_tags => ['sprintf'], | ||
| 37 | }, | ||
| 38 | ], | ||
| 39 | }; | ||
| 40 | |||
| 41 | 1 | 1; | |
| 42 | # ABSTRACT: Benchmark Text::sprintfn vs sprintf() | ||
| 43 | |||
| 44 | __END__ | ||