Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Performance problems on splitting long strings

by Cristoforo (Curate)
on Jan 30, 2014 at 20:42 UTC ( [id://1072729]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Performance problems on splitting long strings
in thread Performance problems on splitting long strings

The $string variable contains '30'. I think you meant

my $string = join '',map { ('a'..'z')[rand 26] }1..30;

With this correction, unpack is faster. :-)

Rate regex1 regex2 substr unpack regex1 225055/s -- -1% -4% -53% regex2 228189/s 1% -- -3% -53% substr 235177/s 4% 3% -- -51% unpack 481548/s 114% 111% 105% --

Replies are listed 'Best First'.
Re^5: Performance problems on splitting long strings
by hdb (Monsignor) on Jan 30, 2014 at 20:53 UTC

    Thanks a lot! Teaches me a well-deserved lesson...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2024-03-28 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found