Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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

by RichardK (Parson)
on Dec 28, 2015 at 12:17 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2020-06-04 23:28 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (35 votes). Check out past polls.