# PODNAME: URI::Fast::Benchmarks

__END__

=pod

=encoding UTF-8

=head1 NAME

URI::Fast::Benchmarks

=head1 VERSION

version 0.02

=head1 BENCHMARKS

Various operations comparing L<URI::Fast> against L<URI>'s performance. The
script to recreate is included in the C<bench> folder of the distribution.

Tests were performed on my development machine, a 2015 MacBook Pro (2.7 GHz
Intel Core i5, 8GB 1867 MHz DDR3 RAM) using Perl 5.24 installed using
L<perlbrew|https://perlbrew.pl>.

=head2 Constructor

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  2 wallclock secs ( 1.48 usr +  0.00 sys =  1.48 CPU) @ 135135.14/s (n=200000)
   URI::Fast:  0 wallclock secs ( 0.58 usr +  0.00 sys =  0.58 CPU) @ 344827.59/s (n=200000)

=head2 Parse scheme

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  3 wallclock secs ( 2.37 usr +  0.00 sys =  2.37 CPU) @ 84388.19/s (n=200000)
   URI::Fast:  1 wallclock secs ( 0.81 usr +  0.00 sys =  0.81 CPU) @ 246913.58/s (n=200000)

=head2 Parse path

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  2 wallclock secs ( 2.40 usr +  0.00 sys =  2.40 CPU) @ 83333.33/s (n=200000)
   URI::Fast:  1 wallclock secs ( 0.85 usr +  0.00 sys =  0.85 CPU) @ 235294.12/s (n=200000)

=head2 Split path

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  3 wallclock secs ( 3.26 usr +  0.01 sys =  3.27 CPU) @ 61162.08/s (n=200000)
   URI::Fast:  2 wallclock secs ( 1.10 usr +  0.00 sys =  1.10 CPU) @ 181818.18/s (n=200000)

=head2 Update path

  Benchmark: timing 200000 iterations of URI, URI::Fast/list, URI::Fast/string...
               URI:  3 wallclock secs ( 2.87 usr +  0.00 sys =  2.87 CPU) @ 69686.41/s (n=200000)
    URI::Fast/list:  1 wallclock secs ( 0.97 usr +  0.00 sys =  0.97 CPU) @ 206185.57/s (n=200000)
  URI::Fast/string:  0 wallclock secs ( 0.87 usr +  0.00 sys =  0.87 CPU) @ 229885.06/s (n=200000)

=head2 Parse authorization

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  3 wallclock secs ( 2.85 usr +  0.01 sys =  2.86 CPU) @ 69930.07/s (n=200000)
   URI::Fast:  2 wallclock secs ( 1.49 usr +  0.00 sys =  1.49 CPU) @ 134228.19/s (n=200000)

=head2 Update authorization

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  4 wallclock secs ( 4.47 usr +  0.00 sys =  4.47 CPU) @ 44742.73/s (n=200000)
   URI::Fast:  2 wallclock secs ( 1.87 usr +  0.00 sys =  1.87 CPU) @ 106951.87/s (n=200000)

=head2 Parse query

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  3 wallclock secs ( 2.49 usr +  0.00 sys =  2.49 CPU) @ 80321.29/s (n=200000)
   URI::Fast:  2 wallclock secs ( 2.10 usr +  0.00 sys =  2.10 CPU) @ 95238.10/s (n=200000)

=head2 Set query parameter

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  4 wallclock secs ( 3.84 usr +  0.01 sys =  3.85 CPU) @ 51948.05/s (n=200000)
   URI::Fast:  3 wallclock secs ( 2.61 usr +  0.00 sys =  2.61 CPU) @ 76628.35/s (n=200000)

=head2 Stringification

  Benchmark: timing 200000 iterations of URI, URI::Fast...
         URI:  2 wallclock secs ( 2.10 usr +  0.00 sys =  2.10 CPU) @ 95238.10/s (n=200000)
   URI::Fast:  1 wallclock secs ( 1.08 usr +  0.00 sys =  1.08 CPU) @ 185185.19/s (n=200000)

=head1 AUTHOR

Jeff Ober <sysread@fastmail.fm>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Jeff Ober.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
