BENCHMARKS
Various operations comparing URI::Fast against URI's performance. The script to recreate is included in the bench
folder of the distribution.
Tests were performed on a Pixelbook (i5) and Perl 5.26.2 installed with perlbrew:
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.
Constructor
Rate URI URI::Fast
URI 129199/s -- -88%
URI::Fast 1111111/s 760% --
Get scheme
Rate URI URI::Fast
URI 104384/s -- -88%
URI::Fast 877193/s 740% --
Set scheme
Rate URI URI::Fast
URI 65274/s -- -92%
URI::Fast 847458/s 1198% --
Get authority
Rate URI URI::Fast
URI 89445/s -- -90%
URI::Fast 925926/s 935% --
Set authority
Rate URI URI::Fast
URI 46253/s -- -93%
URI::Fast 684932/s 1381% --
Get path (scalar)
Rate URI URI::Fast
URI 86207/s -- -86%
URI::Fast 625000/s 625% --
Get path (list)
Rate URI URI::Fast
URI 71633/s -- -85%
URI::Fast 480769/s 571% --
Set path (scalar)
Rate URI URI::Fast
URI 76923/s -- -88%
URI::Fast 617284/s 702% --
Set path (array)
Rate URI URI::Fast
URI 75988/s -- -85%
URI::Fast 515464/s 578% --
Get query
Rate URI URI::Fast
URI 47483/s -- -89%
URI::Fast 413223/s 770% --
Set query parameter
Rate URI URI::Fast
URI 56370/s -- -87%
URI::Fast 438596/s 678% --
Get query (hash)
Rate URI URI::Fast
URI 48263/s -- -87%
URI::Fast 364964/s 656% --
Get query keys
Rate URI URI::Fast
URI 49801/s -- -88%
URI::Fast 416667/s 737% --
Stringification
Rate URI URI::Fast
URI 98814/s -- -79%
URI::Fast 471698/s 377% --
uri_split
Rate URI::Split URI::Fast
URI::Split 495050/s -- -64%
URI::Fast 1388889/s 181% --
Encode
Rate URI::Escape URL::Encode URI::Fast URI::Encode::XS
URI::Escape 5962/s -- -26% -100% -100%
URL::Encode 8071/s 35% -- -99% -99%
URI::Fast 1282051/s 21403% 15785% -- -18%
URI::Encode::XS 1562500/s 26106% 19259% 22% --
Decode
Rate URL::Encode URI::Escape URI::Fast URI::Encode::XS
URL::Encode 6053/s -- -1% -99% -99%
URI::Escape 6098/s 1% -- -99% -99%
URI::Fast 602410/s 9853% 9778% -- -30%
URI::Encode::XS 862069/s 14143% 14036% 43% --
IRI - ctor
Rate IRI URI::Fast
IRI 13998/s -- -99%
URI::Fast 1136364/s 8018% --
IRI - set query (hash)
Rate IRI URI::Fast
IRI 12610/s -- -98%
URI::Fast 595238/s 4620% --
IRI - set param
Rate IRI URI::Fast
IRI 11729/s -- -98%
URI::Fast 510204/s 4250% --
IRI - set path
Rate IRI URI::Fast
IRI 11765/s -- -98%
URI::Fast 675676/s 5643% --