Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Speed of Split

by bart (Canon)
on Nov 18, 2004 at 14:32 UTC ( [id://408770]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Benchmark::cmpthese(0, {
       split        => sub { @data = split(/\s+/, $line) },
    ...
       g            => sub { @data = $line =~ /\S+/g; },
       unpack       => sub { @data = unpack 'A8x6A10A10A10A10A10A10A10A10A
    +10A10A10A10', $line }
    });
    
  2. or download this
                     Rate           g     unpack       split var_length fi
    +xed_length
    g             16954/s          --       -54%        -70%       -76%   
    +      -96%
    ...
    split         56965/s        236%        54%          --       -19%   
    +      -86%
    var_length    70373/s        315%        90%         24%         --   
    +      -83%
    fixed_length 408377/s       2309%      1005%        617%       480%   
    +        --
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-24 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found