# PODNAME: URI::Fast::Benchmarks
# ABSTRACT: Benchmarks comparing URI::Fast and URI

=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 a Pixelbook (i5) and Perl 5.26.2 installed with
L<perlbrew|https://perlbrew.pl>:

  perlbrew install --clang -Dusemymalloc -Doptimize=-O3 perl-5.26.2

Earlier testing was done with a similarly equipped MacBook Pro. It is
interesting to note that URI::Fast's rate is roughly the same, but URI's rate
increased significantly over Perl compiled for MacOS.

=head2 Constructor

                            Rate            URI      URI::Fast
              URI       116822/s             --           -87%
        URI::Fast       892857/s           664%             --


=head2 Get scheme

                            Rate            URI      URI::Fast
              URI        92764/s             --           -89%
        URI::Fast       847458/s           814%             --


=head2 Set scheme

                            Rate            URI      URI::Fast
              URI        57937/s             --           -93%
        URI::Fast       847458/s          1363%             --


=head2 Get authority

                            Rate            URI      URI::Fast
              URI        60606/s             --           -89%
        URI::Fast       555556/s           817%             --


=head2 Set authority

                            Rate            URI      URI::Fast
              URI        38344/s             --           -94%
        URI::Fast       632911/s          1551%             --


=head2 Get path (scalar)

                            Rate            URI      URI::Fast
              URI        85763/s             --           -86%
        URI::Fast       602410/s           602%             --


=head2 Get path (list)

                            Rate            URI      URI::Fast
              URI        71023/s             --           -86%
        URI::Fast       505051/s           611%             --


=head2 Set path (scalar)

                            Rate            URI      URI::Fast
              URI        76453/s             --           -87%
        URI::Fast       588235/s           669%             --


=head2 Set path (array)

                            Rate            URI      URI::Fast
              URI        75758/s             --           -84%
        URI::Fast       471698/s           523%             --


=head2 Get query

                            Rate            URI      URI::Fast
              URI        45579/s             --           -89%
        URI::Fast       423729/s           830%             --


=head2 Set query parameter

                            Rate            URI      URI::Fast
              URI        53706/s             --           -87%
        URI::Fast       413223/s           669%             --


=head2 Get query (hash)

                            Rate            URI      URI::Fast
              URI        45746/s             --           -88%
        URI::Fast       381679/s           734%             --


=head2 Get query keys

                            Rate            URI      URI::Fast
              URI        45537/s             --           -88%
        URI::Fast       384615/s           745%             --


=head2 Stringification

                            Rate            URI      URI::Fast
              URI        83472/s             --           -75%
        URI::Fast       335570/s           302%             --


=head2 uri_split

                            Rate     URI::Split      URI::Fast
       URI::Split       458716/s             --           -55%
        URI::Fast      1020408/s           122%             --


=head2 Encode

                            Rate    URI::Escape    URL::Encode      URI::FastURI::Encode::XS
      URI::Escape         5218/s             --           -26%          -100%          -100%
      URL::Encode         7016/s            34%             --           -99%           -99%
        URI::Fast      1111111/s         21196%         15738%             --            -4%
  URI::Encode::XS      1162791/s         22186%         16474%             5%             --


=head2 Decode

                            Rate    URL::Encode    URI::Escape      URI::FastURI::Encode::XS
      URL::Encode         5568/s             --            -3%           -99%           -99%
      URI::Escape         5714/s             3%             --           -99%           -99%
        URI::Fast       568182/s         10105%          9844%             --           -33%
  URI::Encode::XS       847458/s         15120%         14732%            49%             --


=head2 IRI - ctor

                            Rate            IRI      URI::Fast
              IRI        12207/s             --           -99%
        URI::Fast       847458/s          6842%             --


=head2 IRI - set query (hash)

                            Rate            IRI      URI::Fast
              IRI        11299/s             --           -98%
        URI::Fast       617284/s          5363%             --


=head2 IRI - set param

                            Rate            IRI      URI::Fast
              IRI        11455/s             --           -98%
        URI::Fast       505051/s          4309%             --


=head2 IRI - set path

                            Rate            IRI      URI::Fast
              IRI        11740/s             --           -98%
        URI::Fast       746269/s          6257%             --


