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

Re: Improving script's speed and performance...

by RichardK (Parson)
on Dec 28, 2015 at 12:17 UTC ( [id://1151253]=note: print w/replies, xml ) Need Help??


in reply to Improving script's speed and performance...

How slow is too slow ? You are running through the inner loop 300+ million times, so it might take a while.

Have you tried Profiling your code.? It will tell you where most of the time is being spent, and then you know where the improvements are needed.

A couple of things that might help a bit -

* You could use length to count the characters in a string, which should be quicker the creating an array each time.

* You don't care about the indexes of your arrays so you could write your loops like this :-

for my $lhs (@array1) { ... for my $rhs (@array2) { lcssw($lhs, $rhs); ... } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-16 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found