NAME

FU::Benchmarks - A bunch of automated benchmark results.

DESCRIPTION

This file is automatically generated from 'bench.PL' in the FU distribution. These benchmarks compare performance of some FU functionality against similar modules found on CPAN.

DISCLAIMER#1: Obtaining accurate measurements is notoriously hard. Take the numbers below with a few buckets of salt, any difference below 10% is most likely noise.

DISCLAIMER#2: Goodhart's law: "When a measure becomes a target, it ceases to be a good measure". I've used these benchmarks to find and optimize hotspots in FU, which in turn means these numbers may look better than they are in real-world use.

DISCLAIMER#3: Many of these benchmarks exists solely to test edge case performance, these numbers are not representative for real-world use.

MODULE VERSIONS

The following module versions were used:

Cpanel::JSON::XS 4.38
FU 0.1
HTML::Tiny 1.08
JSON::PP 4.16
JSON::SIMD 1.06
JSON::Tiny 0.58
JSON::XS 4.03
TUWF::XML 1.5
XML::Writer 0.900

BENCHMARKS

JSON Parsing & Formatting

These benchmarks run on large-ish arrays with repeated values. JSON encoding is sufficiently fast that Perl function calling overhead tends to dominate for smaller inputs, but I don't find that overhead very interesting.

Also worth noting that JSON::SIMD formatting code is forked from JSON::XS, the SIMD parts are only used for parsing.

API object from JSON::XS documentation.

                      Encode   Canonical      Decode
        JSON::PP      5312/s      5119/s      1290/s
      JSON::Tiny      7757/s           -      3426/s
Cpanel::JSON::XS    108187/s    101867/s    103575/s
      JSON::SIMD    130137/s    118948/s    115123/s
        JSON::XS    128421/s    120243/s    117940/s
        FU::Util    133182/s    113275/s    118213/s

Object (small)

                      Encode   Canonical      Decode
        JSON::PP       907/s       829/s       202/s
      JSON::Tiny      1224/s           -       499/s
Cpanel::JSON::XS     43168/s     28114/s     19229/s
      JSON::SIMD     49019/s     30699/s     23267/s
        JSON::XS     49814/s     31326/s     25336/s
        FU::Util     44110/s     26134/s     21144/s

Object (large)

                      Encode   Canonical      Decode
        JSON::PP       927/s       747/s       104/s
      JSON::Tiny      1108/s           -       392/s
Cpanel::JSON::XS     29672/s     12637/s     16609/s
      JSON::SIMD     24418/s     12388/s     22895/s
        JSON::XS     23192/s     13174/s     23553/s
        FU::Util     39477/s     13567/s     17178/s

Object (large, mixed unicode)

                      Encode   Canonical      Decode
        JSON::PP       817/s       679/s        86/s
      JSON::Tiny      1036/s           -       402/s
Cpanel::JSON::XS     20437/s      1345/s      7408/s
      JSON::SIMD     25031/s      1331/s     15997/s
        JSON::XS     23580/s      1375/s      8526/s
        FU::Util     34435/s     11916/s      9419/s

Small integers

                      Encode      Decode
        JSON::PP       113/s        29/s
      JSON::Tiny       160/s        86/s
Cpanel::JSON::XS      7137/s      6083/s
      JSON::SIMD      7963/s      4361/s
        JSON::XS      7915/s      6058/s
        FU::Util      8565/s      5639/s

Large integers

                      Encode      Decode
        JSON::PP      2176/s       329/s
      JSON::Tiny      2999/s      1638/s
Cpanel::JSON::XS     31302/s     48892/s
      JSON::SIMD     37201/s     51719/s
        JSON::XS     36722/s     50110/s
        FU::Util    116188/s     62110/s

ASCII strings

                      Encode      Decode
        JSON::PP      2934/s       336/s
      JSON::Tiny      4126/s      1439/s
Cpanel::JSON::XS    116744/s     43489/s
      JSON::SIMD    134711/s     50429/s
        JSON::XS    135419/s     43976/s
        FU::Util    182026/s     44312/s

Unicode strings

                      Encode      Decode
        JSON::PP      5113/s       253/s
      JSON::Tiny      6603/s      2585/s
Cpanel::JSON::XS     91704/s     64489/s
      JSON::SIMD    106928/s    102440/s
        JSON::XS    105473/s     60558/s
        FU::Util    217135/s     58972/s

String escaping (few)

                      Encode      Decode
        JSON::PP      4251/s       352/s
      JSON::Tiny      4704/s      1869/s
Cpanel::JSON::XS    131789/s    106306/s
      JSON::SIMD    158171/s    153692/s
        JSON::XS    157261/s     97676/s
        FU::Util    191699/s     91177/s

String escaping (many)

                      Encode      Decode
        JSON::PP      2224/s       366/s
      JSON::Tiny      2884/s       984/s
Cpanel::JSON::XS    136583/s    100789/s
      JSON::SIMD    152951/s    113242/s
        JSON::XS    153471/s    106269/s
        FU::Util    142604/s     97984/s

XML Writing

HTML fragment

    TUWF::XML       795/s
  XML::Writer       833/s
   HTML::Tiny       423/s
FU::XMLWriter      5285/s