Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Performance problems on splitting long strings

by hdb (Monsignor)
on Jan 30, 2014 at 20:12 UTC ( [id://1072725]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
               unpack => sub { @sub_fields = unpack '(A4)*', $string },
               substr => sub { @sub_fields = map { substr $string, 5*$_, 5
    + } 0..length( $string )/5-1 },
              });
    
  2. or download this
                 Rate substr unpack regex1 regex2
    substr   696486/s     --   -57%   -94%   -94%
    unpack  1603093/s   130%     --   -85%   -86%
    regex1 10731041/s  1441%   569%     --    -4%
    regex2 11165392/s  1503%   596%     4%     --
    

Log In?
Username:
Password:

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

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

    No recent polls found