We could have executed the script with dprofppand then interpreted the results by entering the single command dprofpp-pdirwalk; unfortunately, it would still have generated the tmon.out file. We would like to see an option for Devel::DProf to pipe its output into dprofpp to eliminate the temporary file. Warning: The tmon.out file can get extraordinarily large very quickly (the one for the previous test was 1.3MB). Before you run a large test, make sure you have an idea of how big it is likely to get by running smaller tests if necessary. Use Devel::DProfto profile programs for bottlenecks. 11.3 Making Things Better Here we discuss a few ways of improving your program’s use of resources. You’ll find terse descriptions of many more in Programming Perl (Chapter 8 in the second edition, Chapter 24 in the third). 11.3.1 Improving Execution Speed It is common for improvements in execution speed to cost dearly in the readability department. Adding lookup caches, rearranging statement order, and inlining subroutine calls conspire to make a program less maintainable; therefore, as we have said before, you do these things only when you have to. Once you’ve identified the code that is taking the most time, the next step is to optimize that code. A few suggestions follow. possible. Inside a loop, take every opportunity to get out of it as early as I was just now writing some code to parse a log file containing lines like 20010208001507:POP3- Server:[198.137.241.43]:gwbush The first statement in the loop was: next unless my ($year, $month, $day, $hour, $minute, $second, $user) = /(dddd)(dd)(dd)(dd)(dd)(dd):POP3- Server:.*:(.*)/; This may have been a natural translation of the obvious solution, but it was a tad slow on a 3 million line log file! Since many input lines did not
Note: If you are looking for cheap and quality provider to host and run your java application check Astra java hosting services