mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-20 13:33:51 +01:00
perl: tweaks for benchmarks
This commit is contained in:
parent
49379140c7
commit
cb85dcfcb8
6
perl/benchmark/data.pl
Executable file
6
perl/benchmark/data.pl
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
+{
|
||||||
|
"method" => "handleMessage",
|
||||||
|
"params" => [ "user1", "we were just talking", "foo\nbar\nbaz\nqux" ],
|
||||||
|
"id" => undef,
|
||||||
|
"array" => [ 1, 1024, 70000, -5, 1e5, 1e7, 1, 0, 3.14, sqrt(2), 1 .. 100 ],
|
||||||
|
};
|
@ -7,12 +7,8 @@ use Storable;
|
|||||||
|
|
||||||
#$Data::MessagePack::PreferInteger = 1;
|
#$Data::MessagePack::PreferInteger = 1;
|
||||||
|
|
||||||
my $a = {
|
my $a = do 'benchmark/data.pl';
|
||||||
"method" => "handleMessage",
|
|
||||||
"params" => [ "user1", "we were just talking" ],
|
|
||||||
"id" => undef,
|
|
||||||
"array" => [ 1, 1024, 70000, -5, 1e5, 1e7, 1, 0, 3.14, sqrt(2) ],
|
|
||||||
};
|
|
||||||
my $j = JSON::XS::encode_json($a);
|
my $j = JSON::XS::encode_json($a);
|
||||||
my $m = Data::MessagePack->pack($a);
|
my $m = Data::MessagePack->pack($a);
|
||||||
my $s = Storable::freeze($a);
|
my $s = Storable::freeze($a);
|
||||||
|
@ -5,12 +5,7 @@ use JSON::XS;
|
|||||||
use Storable;
|
use Storable;
|
||||||
use Benchmark ':all';
|
use Benchmark ':all';
|
||||||
|
|
||||||
my $a = {
|
my $a = do 'benchmark/data.pl';
|
||||||
"method" => "handleMessage",
|
|
||||||
"params" => [ "user1", "we were just talking" ],
|
|
||||||
"id" => undef,
|
|
||||||
"array" => [ 1, 1024, 70000, -5, 1e5, 1e7, 1, 0, 3.14, sqrt(2) ],
|
|
||||||
};
|
|
||||||
|
|
||||||
print "-- serialize\n";
|
print "-- serialize\n";
|
||||||
print "JSON::XS: $JSON::XS::VERSION\n";
|
print "JSON::XS: $JSON::XS::VERSION\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user