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

Re: Fastest split possible

by Discipulus (Canon)
on Nov 06, 2019 at 19:49 UTC ( [id://11108399]=note: print w/replies, xml ) Need Help??


in reply to Fastest split possible

Hello pedrete,

to see it you can use Benchmark to test different approach, like capturing using regexes with g modifier.

But probably, if you are experienceing slowness with split which is fast, you simply have to avoid to accumulate results into @array

Infact if $HugeString is huge, would be probably better to process each element directly like in:

process($_) for split /\n/,$HugeString;

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

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

    No recent polls found