Digest-JHash

 view release on metacpan or  search on metacpan

examples/oo_vs_func.pl  view on Meta::CPAN

# this is one of the reasons so many people write shit code in Perl.
printf "\nOO %d\nFF %d\n", $oo, $ff;

package Foo;

sub new { bless { key => 'val' }, shift }

sub do_foo { $_[0] ? $Test::oo++ : $Test::ff++ }

__DATA__
Benchmark: timing 10000000 iterations of Function, Import, OO...
  Function:  8 wallclock secs ( 7.99 usr +  0.00 sys =  7.99 CPU) @ 1251251.25/s (n=10000000)
    Import: 12 wallclock secs (12.72 usr +  0.00 sys = 12.72 CPU) @ 786225.33/s (n=10000000)
        OO:  9 wallclock secs ( 9.33 usr +  0.00 sys =  9.33 CPU) @ 1071352.05/s (n=10000000)

OO 10000000
FF 20000000



( run in 1.465 second using v1.01-cache-2.11-cpan-71847e10f99 )