Add benchmarking tool + improve integer formatting performance

Typical priorities: make it fast before fixing all the bugs. *shrug*
This commit is contained in:
Yorhel 2025-01-28 14:49:29 +01:00
parent c16a9fa493
commit 9c8ce3f782
4 changed files with 259 additions and 13 deletions

View file

@ -17,17 +17,14 @@ doesn't believe in the concept of a "batteries included" standard library.
This module comes with a custom C-based JSON parser and formatter. These
functions conform strictly to L<RFC-8259|https://tools.ietf.org/html/rfc8259>,
non-standard extensions are not supported and never will be.
non-standard extensions are not supported and never will be. It also happens to
be pretty fast, refer to L<FU::Benchmarks> for some numbers.
JSON booleans are decoded into C<builtin::true> and C<builtin::false>. When
formatting, those builtin constants are the I<only> recognized boolean values -
alternative representations such as C<JSON::PP::true> and C<JSON::PP::false>
are not recognized and attempting to format such values will croak.
I<TODO: point to benchmarks.>
I<TODO: FU::JSON wrapper with somewhat-compatible JSON::{PP,XS} API>
=over
=item json_format($scalar, %options)