Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Fastest way to lookup a point in a set (compares Perl 5.8.9 - 5.26.0)

by marioroy (Prior)
on Aug 06, 2017 at 18:01 UTC ( [id://1196857]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub mat_look {
       my $cells = shift;
    ...
       exists $cells->{'notfound3'} and die;
    }
    
  2. 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
    +] }
    };
    
  3. 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)
    
  4. 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)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1196857]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found