Created
November 8, 2010 00:40
-
-
Save nrh/667234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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% -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment