mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 04:52:59 +01:00
Add various integers to benchmarks
This commit is contained in:
parent
af73b9d11b
commit
0e0a2aa981
@ -5,11 +5,13 @@ use JSON::XS;
|
|||||||
use Benchmark ':all';
|
use Benchmark ':all';
|
||||||
use Storable;
|
use Storable;
|
||||||
|
|
||||||
|
#$Data::MessagePack::PreferInteger = 1;
|
||||||
|
|
||||||
my $a = {
|
my $a = {
|
||||||
"method" => "handleMessage",
|
"method" => "handleMessage",
|
||||||
"params" => [ "user1", "we were just talking" ],
|
"params" => [ "user1", "we were just talking" ],
|
||||||
"id" => undef,
|
"id" => undef,
|
||||||
"array" => [ 1, 11, 234, -5, 1e5, 1e7, 1, 0, 3.14, sqrt(2) ]
|
"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);
|
||||||
|
@ -9,7 +9,7 @@ my $a = {
|
|||||||
"method" => "handleMessage",
|
"method" => "handleMessage",
|
||||||
"params" => [ "user1", "we were just talking" ],
|
"params" => [ "user1", "we were just talking" ],
|
||||||
"id" => undef,
|
"id" => undef,
|
||||||
"array" => [ 1, 11, 234, -5, 1e5, 1e7, 1, 0, 3.14, sqrt(2) ]
|
"array" => [ 1, 1024, 70000, -5, 1e5, 1e7, 1, 0, 3.14, sqrt(2) ],
|
||||||
};
|
};
|
||||||
|
|
||||||
print "-- serialize\n";
|
print "-- serialize\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user