Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Speed up perl code

by fluffyvoidwarrior (Monk)
on Sep 21, 2012 at 07:55 UTC ( #994841=note: print w/replies, xml ) Need Help??

in reply to Speed up perl code

Lots of code.

Just a few generic suggestions that you've probably thought of anyway
Some jobs are actually big and do take a long time. However it's easy to make a job big that shouldn't be. I would suggest going back to basics for a few hours and pondering the underlying design of your program. Have you intrinsically designed it wrong? Is there a better approach to the same goal? Are you not processing in a smart way, perhaps multiplying the work as your program runs rather than reducing it. Its easy to tend towards infinite with something that's OK on a small dataset but multiplies up exponentially when you feed it large data.

Assuming you can only go down the route you have already taken:-
Have you specifically located the bottlenecks? Maybe when you do you should then benchmark chunks of code and run repeatedly with modifications.

You may find that you need to write your own optimised code for the cutting edge to your particular problem, rather than use a generic cpan module.

My guess is that you'll get a lot more help on here if you locate your problem areas, present much smaller code snippets and ask "How can I speed this up?"

Either way, there probably isn't much point in speculating 'till you've located the bottleneck(s). Possible quick fix : if it's thrashing your hard drive move it to a ramdisk.

Check this out:

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994841]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2018-03-20 12:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (250 votes). Check out past polls.