Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)

by Corion (Patriarch)
on Sep 12, 2007 at 14:35 UTC ( [id://638572]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub map_split {
        my $ofs = 0;
        join "", map { $ofs += length; $_ => substr $s2, $ofs++, 1 } split
    + /\0/, $s1, -1;
    };
    
  2. or download this
    sub map_split_join {
    
        my $ofs = 0;
        join "", map { $ofs += length; $_ . substr $s2, $ofs++, 1 } split 
    +/\0/, $s1, -1;
    };
    
  3. or download this
                     Rate map_split_join          subst      map_split
    map_split_join 1697/s             --            -7%           -13%
    subst          1828/s             8%             --            -6%
    map_split      1949/s            15%             7%             --
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-03-28 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found