Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: match two files

by hippo (Chancellor)
on Jun 03, 2020 at 09:21 UTC ( #11117636=note: print w/replies, xml ) Need Help??

in reply to match two files

How I can shorter the running time by change some code?

Although it's hard to spot because of the random indenting, you have a pair of nested loops. Inside the inner loop you have this line:


which serves absolutely no purpose. The first change you should make is therefore to remove this line.

Then you might look at your algorithm. Why are you doing the same processing on the entries in @lines2 over and over again? Just process it once, pop the results in a hash for fast lookup and your code will whizz.

Three more tips:

Good luck.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2020-08-05 05:18 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (35 votes). Check out past polls.