Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Fastest way to lookup a point in a set (added test script)

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

Help for this page

Select Code to Download


  1. 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
    +] }
    };
    
  2. or download this
    use strict;
    # use warnings;
    ...
       Str => sub { str_look($str_ref) }, # $cells->{ $p->[0] .':'. $p->[1
    +] }
    };
    
  3. or download this
    config_args='-Dprefix=/opt/perl-5.26.0 -sder -Dusethreads -Accflags=-m
    +sse4.2'
    
  4. or download this
    $ /usr/bin/perl test.pl
    Benchmark: timing 200000 iterations of Big, Kgb, Lan, Mat, Pak, St2, S
    +t3, Str...
    ...
     St3: 1 wallclock secs ( 1.55 usr + 0.0 sys = 1.55 CPU) @ 129032.26/s 
    +(n=200000)
     Str: 4 wallclock secs ( 3.48 usr + 0.0 sys = 3.48 CPU) @  57471.26/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://1196868]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found