jsonfmt: Add canonical option

Not as bad as I had expected it to be; managed to keep the
implementation a little bit simpler and cleaner than JSON::XS.
This commit is contained in:
Yorhel 2025-01-29 18:42:27 +01:00
parent 163a60b4ba
commit 1a0fb03205
5 changed files with 115 additions and 23 deletions

View file

@ -104,6 +104,22 @@ String escaping (many)
JSON::XS 154280/s
FU::Util 132514/s
Canonical hash key ordering (small)
JSON::PP 835/s
Cpanel::JSON::XS 28155/s
JSON::SIMD 30066/s
JSON::XS 32151/s
FU::Util 27079/s
Canonical hash key ordering (large)
JSON::PP 756/s
Cpanel::JSON::XS 10710/s
JSON::SIMD 12640/s
JSON::XS 12858/s
FU::Util 12819/s
=cut
@ -114,6 +130,16 @@ jsonfmt/api FU::Util FU 0.1 129117
jsonfmt/api JSON::PP JSON::PP 4.16 5342
jsonfmt/api JSON::SIMD JSON::SIMD 1.06 128161
jsonfmt/api JSON::XS JSON::XS 4.03 130434
jsonfmt/canonl Cpanel::JSON::XS Cpanel::JSON::XS 4.38 10710
jsonfmt/canonl FU::Util FU 0.1 12819
jsonfmt/canonl JSON::PP JSON::PP 4.16 756
jsonfmt/canonl JSON::SIMD JSON::SIMD 1.06 12640
jsonfmt/canonl JSON::XS JSON::XS 4.03 12858
jsonfmt/canons Cpanel::JSON::XS Cpanel::JSON::XS 4.38 28155
jsonfmt/canons FU::Util FU 0.1 27079
jsonfmt/canons JSON::PP JSON::PP 4.16 835
jsonfmt/canons JSON::SIMD JSON::SIMD 1.06 30066
jsonfmt/canons JSON::XS JSON::XS 4.03 32151
jsonfmt/intl Cpanel::JSON::XS Cpanel::JSON::XS 4.38 29299
jsonfmt/intl FU::Util FU 0.1 114084
jsonfmt/intl JSON::PP JSON::PP 4.16 2208