- SEE ALSO
- COPYRIGHT AND LICENSE
YAML::PP::LibYAML - Faster parsing for YAML::PP
use YAML::PP::LibYAML; # use it just like YAML::PP my $yp = YAML::PP::LibYAML->new; my @docs = $yp->load_string($yaml); # Legacy interface use YAML::PP::LibYAML qw/ Load /; my @docs = Load($yaml);
YAML::PP::LibYAML is a subclass of YAML::PP. Instead of using YAML::PP::Parser as a the backend parser, it uses YAML::PP::LibYAML::Parser which calls YAML::LibYAML::API, an XS wrapper around the
The things it cannot parse are often not relevant to real world usage.
YAML::XS combines a wrapper around libyaml and the code for constructing/deconstructing the data into one single API, almost completely written in XS.
That makes it very fast, but the part of constructing the data is not very flexible simply because it's more work to write this in C. It conforms to only a subset of the YAML 1.1 types and tags.
YAML::PP aims to build a powerful and flexible API for the data construction part. Its parser aims to fully support YAML 1.2 syntactically, which mostly includes 1.1, but it's not quite there yet. It parses things that libyaml doesn't, but the opposite is also true.
YAML::LibYAML::API is a wrapper around the libyaml parser.
Combining YAML::LibYAML::API and YAML::PP gives you the flexibility of the loading API and the speed of the quite robust libyaml parser, although it's still much slower than YAML::XS. Benchmarks will follow.
- load_string, load_file, dump_string, dump_file
Work like in YAML::PP
- Load, Dump, LoadFile, DumpFile
Work like in YAML::PP (and in all other well known YAML loaders).
The only difference is, none of them is exported by default.
Tina Müller <email@example.com>
Copyright 2018 by Tina Müller
This library is free software and may be distributed under the same terms as perl itself.