Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/perl -w
- use common::sense;
- use Benchmark qw(:all);
- use YAML::Syck qw();
- use YAML::XS qw();
- my $yaml = `cat foo.yaml`;
- cmpthese(1000,
- {
- 'syck' => sub { my $obj = YAML::Syck::Load($yaml); my $string = YAML::Syck::Dump($obj); },
- 'xs' => sub { my $obj = YAML::XS::Load($yaml); my $string = YAML::XS::Dump($obj); },
- });
- [nrh@toki ~/projects/pogo] perl comp.pl
- (warning: too few iterations for a reliable count)
- Rate xs syck
- xs 34.9/s -- -99%
- syck 6250/s 17806% --
Add Comment
Please, Sign In to add comment