Bencher-Scenarios-StringFunctions

 view release on metacpan or  search on metacpan

lib/Bencher/Scenario/StringFunctions/Indent.pm  view on Meta::CPAN

Function call template:

 String::Indent::indent(<indent>, <str>)



=item * String::Indent::Join::indent (perl_code)

Function call template:

 String::Indent::Join::indent(<indent>, <str>)



=back

=head1 BENCHMARK DATASETS

=over

=item * empty

=item * 1line

=item * 10line

=item * 100line

=item * 1000line

=back

=head1 SAMPLE BENCHMARK RESULTS

Run on: perl: I<< v5.34.0 >>, CPU: I<< Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (2 cores) >>, OS: I<< GNU/Linux Ubuntu version 20.04 >>, OS kernel: I<< Linux version 5.4.0-91-generic >>.

Benchmark with default options (C<< bencher -m StringFunctions::Indent >>):

 #table1#
 {dataset=>"1000line"}
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | participant                  | rate (/s) | time (μs) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | String::Indent::indent       |      2570 |       390 |                 0.00% |                47.77% | 1.6e-07 |      20 |
 | String::Nudge::nudge         |      3650 |       274 |                42.25% |                 3.88% | 2.1e-07 |      20 |
 | String::Indent::Join::indent |      3790 |       264 |                47.77% |                 0.00% | 2.1e-07 |      20 |
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+

Formatted as L<Benchmark.pm|Benchmark> result:

           Rate  SI:i  SN:n  SIJ:i 
  SI:i   2570/s    --  -29%   -32% 
  SN:n   3650/s   42%    --    -3% 
  SIJ:i  3790/s   47%    3%     -- 
 
 Legends:
   SI:i: participant=String::Indent::indent
   SIJ:i: participant=String::Indent::Join::indent
   SN:n: participant=String::Nudge::nudge

=for html <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkY...


 #table2#
 {dataset=>"100line"}
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | participant                  | rate (/s) | time (μs) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | String::Indent::indent       |     24000 |      41.7 |                 0.00% |                72.08% | 1.1e-08 |      28 |
 | String::Nudge::nudge         |     33400 |      29.9 |                39.57% |                23.29% | 1.2e-08 |      26 |
 | String::Indent::Join::indent |     41200 |      24.3 |                72.08% |                 0.00% | 6.4e-09 |      22 |
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+

Formatted as L<Benchmark.pm|Benchmark> result:

            Rate  SI:i  SN:n  SIJ:i 
  SI:i   24000/s    --  -28%   -41% 
  SN:n   33400/s   39%    --   -18% 
  SIJ:i  41200/s   71%   23%     -- 
 
 Legends:
   SI:i: participant=String::Indent::indent
   SIJ:i: participant=String::Indent::Join::indent
   SN:n: participant=String::Nudge::nudge

=for html <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkY...


 #table3#
 {dataset=>"10line"}
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | participant                  | rate (/s) | time (μs) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | String::Indent::indent       |    188000 |      5.33 |                 0.00% |                95.85% | 1.7e-09 |      20 |
 | String::Nudge::nudge         |    249000 |      4.02 |                32.76% |                47.52% | 1.6e-09 |      23 |
 | String::Indent::Join::indent |    367000 |      2.72 |                95.85% |                 0.00% | 8.3e-10 |      20 |
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+

Formatted as L<Benchmark.pm|Benchmark> result:

             Rate  SI:i  SN:n  SIJ:i 
  SI:i   188000/s    --  -24%   -48% 
  SN:n   249000/s   32%    --   -32% 
  SIJ:i  367000/s   95%   47%     -- 
 
 Legends:
   SI:i: participant=String::Indent::indent
   SIJ:i: participant=String::Indent::Join::indent
   SN:n: participant=String::Nudge::nudge

=for html <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkY...


 #table4#
 {dataset=>"1line"}
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | participant                  | rate (/s) | time (ns) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
 +------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | String::Indent::indent       |    724000 |      1380 |                 0.00% |               166.48% | 4.2e-10 |      20 |
 | String::Nudge::nudge         |    876000 |      1140 |                20.99% |               120.26% | 4.2e-10 |      20 |
 | String::Indent::Join::indent |   1930000 |       518 |               166.48% |                 0.00% | 1.7e-11 |      30 |



( run in 1.370 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )