Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Optimization of script

by ww (Archbishop)
on Aug 18, 2016 at 15:40 UTC ( #1170001=note: print w/replies, xml ) Need Help??

in reply to Optimization of script

Without studying your code (220 lines is a lot to ask of freebie help; 20 illustrating the same problem is much preferred), you might want to try profiling your code -- Dev::Deprof, Devel:NYTProf, etc. -- though your problem may be in the access time for data stored (somewhere... where?) with your "legacy...application." Also, you're running a lot of counters, each of which eats up cycles and could, as they and your export files get larger, slow your process.

And (afterthought!) if your data is in CSV files, why not inport the old data to a DB -- MySQL, SQLite, etc, and let the database engine do the counting and sorting? If necessary (and you may be able to export more-or-less direct to Excel files) the worst (IMO) that does is require you to reexport to CSV's and then export/store those as Excel files.

Hope this helps; I know it's not a careful review of your code nor an Rx for optomizing it, but as I said above, a post with 200+ lines of code (and no data) is a lot with which to burden the Monks. Please On asking for help & How do I post a question effectively?.

++$anecdote ne $data

Replies are listed 'Best First'.
Re^2: Optimization of script
by JulioRD (Initiate) on Aug 18, 2016 at 19:56 UTC

    Thanks ww. I appreciate taking the time to comment on the post. I do understand is a lot of code, but since I'm starting to learn how to do PERL there's a lot of things I'm not familiar with. Did not want to leave anything out in case there's something obvious I have not done. Apologize for the lengthy post (and now the long response, lol). Guess I was more focused on the solution than comunincating it well on the forum. Will do better next time.

    Thanks for the info about the profiler and other options, this is a one time script for a very specific task. a one and done type of deal. So need to weigh all the options and see how much more effort to dedicate. Thanks again from Dominican Republic. Come visit.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-06-20 07:55 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.