Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^4: Performance problems on splitting long strings

by Jim (Curate)
on Feb 01, 2014 at 22:25 UTC ( [id://1073003]=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

And yes, I was sort of expecting unpack() to be faster, but it is still better to try it to be sure.

Indeed. I certainly didn't mean to suggest your benchmark test wasn't a splendid idea. I only meant that, in this case, the outcome of the benchmark test was consistent with one's rational expectation based on one's understanding of unpack() and its raison d'être. After all, the Perl FAQ states:

C:\>perldoc -q fixed | head -5 Found in C:\strawberry\perl\lib\perlfaq5.pod How can I manipulate fixed-record-length files? The most efficient way is using pack() and unpack(). This is faste +r than using substr() when taking many, many strings. It is slower for ju +st a few. C:\>

Jim

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-25 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found