;
use IPC::SysV qw(
IPC_PRIVATE
IPC_CREAT
IPC_EXCL
IPC_NOWAIT
SEM_UNDO
);
use JSON qw(-convert_blessed_universally);
use Scalar::Util;
use String::CRC32;
use Storable 0.6 qw(freeze
storable') {
return _freeze($seg, $data);
}
elsif ($serializer eq 'json'){
return _encode_json($seg, $data);
}
return undef;
}
sub _end {
for my $s (values %proces
r eq 'json'){
return _decode_json($seg);
}
return undef;
}
sub _encode_json {
my $seg = shift;
my $data = shift;
my $json = encode_json $data;
if (length($json) > $
erl
use warnings;
use strict;
use Benchmark qw(:all) ;
use Data::Dumper;
use IPC::Shareable;
use JSON qw(-convert_blessed_universally);
use Storable qw(freeze thaw);
if (@ARGV < 1){
print "\n Ne
ash;
#timethese($ARGV[0],
# {
# json => \&json,
# store => \&storable,
# },
#);
cmpthese($ARGV[0],
{
json => \&json,
store => \&storable,
},
);
sub json {
my $base_data = default();
if (! %j_hash) {
tie %j_hash, 'IPC::Shareable', {
create => 1,
destroy => 1,
serializer => 'json'
#!/usr/bin/env perl
use warnings;
use strict;
use Benchmark qw(:all) ;
use JSON qw(-convert_blessed_universally);
use Sereal qw(encode_sereal decode_sereal looks_like_sereal);
use Storable qw(freeze
tore => \&storable,
json => \&json,
},
);
cmpthese($ARGV[0],
{
sereal => \&serial,
store => \&storable,
json => \&json,
},
);
sub _data {
m
> {z => 26, y => 25},
);
return \%h;
}
sub json {
my $data = _data();
my $json = encode_json $data;
my $perl = decode_json $json;
}
sub serial {
my $data = _data();
my $en