- or download this
sub mat_look {
my $cells = shift;
...
exists $cells->{'notfound3'} and die;
}
- or download this
timethese 200000, {
Big => sub { big_look($big_ref) }, # $cells->{ ($p->[1] << 32) | ($
+p->[0] & 0xFFFFFFFF) }
...
Str => sub { str_look($str_ref) }, # $cells->{ $p->[0] .':'. $p->[1
+] }
};
- or download this
$ /opt/perl-5.8.9/bin/perl test.pl
Benchmark: timing 200000 iterations of Big, Lan, Mat, Pak, St2, St3, S
+tr...
...
St3: 2 wallclock secs ( 2.17 usr + 0.01 sys = 2.18 CPU) @ 91743.12/s
+(n=200000)
Str: 5 wallclock secs ( 4.78 usr + 0.01 sys = 4.79 CPU) @ 41753.65/s
+(n=200000)
- or download this
$ /opt/cperl-5.24.2c/bin/cperl test.pl
Benchmark: timing 200000 iterations of Big, Lan, Mat, Pak, St2, St3, S
+tr...
...
St3: 3 wallclock secs ( 2.09 usr + 0.00 sys = 2.09 CPU) @ 95693.78/s
+(n=200000)
Str: 4 wallclock secs ( 4.61 usr + 0.00 sys = 4.61 CPU) @ 43383.95/s
+(n=200000)