9 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use Benchmark qw(cmpthese);
use IPC::ShareLite;
{
my $share = new IPC::ShareLite( -key => 1971,
-create => 'yes',
-destroy => 'no' ) or die $!;
open(my $bla, $0) or die $!;
$share->store(join "", <$bla>);
}
cmpthese(-1,
{fs => sub {
open(my $bla, $0) or die $!;
local $/ = undef;
my $buf = <$bla>;
#warn $buf
},
ipc => sub {
my $share = new IPC::ShareLite( -key => 1971,
-create => 'no',
-destroy => 'no' ) or die $!;
$share->fetch;
}
},
);
1
2
3
4
5
6
Benchmark: running fs, ipc for at least 1 CPU seconds...
fs: 1 wallclock secs ( 0.76 usr + 0.26 sys = 1.02 CPU) @ 44383.33/s (n=45271)
ipc: 2 wallclock secs ( 0.91 usr + 0.13 sys = 1.04 CPU) @ 11486.54/s (n=11946)
Rate ipc fs
ipc 11487/s -- -74%
fs 44383/s 286% --
9 Einträge, 1 Seite |