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

Re^2: Fastest way to lookup a point in a set

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

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        }
    }
    
  2. or download this
    use Data::Dump qw(pp);
    
    ...
       Str => sub { str_look($str_ref) }, # $cells->{ $p->[0] .':'. $p->[1
    +] }
    };
    
  3. or download this
    $ /opt/perl-5.24.2/bin/perl test.pl
    Benchmark: timing 200000 iterations of Big, Kgb, Lan, Mat, Pak, St2, S
    +t3, Str...
    ...
     St3: 2 wallclock secs ( 2.03 usr + 0.00 sys = 2.03 CPU) @ 98522.17/s 
    +(n=200000)
     Str: 4 wallclock secs ( 4.51 usr + 0.00 sys = 4.51 CPU) @ 44345.90/s 
    +(n=200000)
    
  4. or download this
    Benchmark: timing 200000 iterations of Big, Kgb, Lan, Mat, Pak, St2, S
    +t3, Str...
     Big: 6 wallclock secs ( 5.69 usr + 0.00 sys = 5.69 CPU) @ 35149.38/s 
    +(n=200000)
    ...
     St3: 2 wallclock secs ( 2.13 usr + 0.00 sys = 2.13 CPU) @ 93896.71/s 
    +(n=200000)
     Str: 5 wallclock secs ( 4.58 usr + 0.00 sys = 4.58 CPU) @ 43668.12/s 
    +(n=200000)
    
  5. or download this
    sub kgb_look {
       my $cells = shift;
    ...
    Initialization of state variables in list context currently forbidden 
    +at test.pl line 341, near "@points;"
    Execution of test.pl aborted due to compilation errors.
    
  6. or download this
    use feature qw(state);
    
    ...
       exists $cells->{'notfound3'} and die;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-26 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found