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%   
    +        --