mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 13:02:13 +01:00
perl: added benchmark script for deserialization
This commit is contained in:
parent
0b083030b1
commit
45321baa66
20
perl/benchmark/deserialize.pl
Normal file
20
perl/benchmark/deserialize.pl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Data::MessagePack;
|
||||||
|
use JSON::XS;
|
||||||
|
use Benchmark ':all';
|
||||||
|
|
||||||
|
my $a = [0..2**24];
|
||||||
|
my $j = JSON::XS::encode_json($a);
|
||||||
|
my $m = Data::MessagePack->pack($a);
|
||||||
|
|
||||||
|
print "-- deserialize\n";
|
||||||
|
print "JSON::XS: $JSON::XS::VERSION\n";
|
||||||
|
print "Data::MessagePack: $Data::MessagePack::VERSION\n";
|
||||||
|
cmpthese(
|
||||||
|
-1 => {
|
||||||
|
json => sub { JSON::XS::decode_json($j) },
|
||||||
|
mp => sub { Data::MessagePack->unpack($m) },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user