Posted by brian d foy on October 23, 2011
Profile before you decide where to optimize—you might be surprised where you’re losing all of your performance. We won’t go into all the details of profiling in this Item, but you can read about those in Mastering Perl. In short, profilers count something then report the results. They can track any of the things that [...]
Posted by Josh McAdams on August 8, 2010
My choice of algorithms and data organization can lead to orders of magnitude of performance differences between functionally equivalent implementations of my programs. Choosing the right way to do something can save me orders of magnitude in processing. I wrote some code to loop over lines in a file and modify a couple of elements [...]
Posted by Josh McAdams on June 20, 2010
In Item 33: “Watch out for match variables, you found out that the match variable $`, $&, and $` come with a performance hit. With all of the module code that you might use, you might be using those variables even though you didn’t code with them yourself. There’s a module that can tell you [...]
Posted by brian d foy on May 9, 2010
Just because you find a module that does something doesn’t mean that you have to use it. There are many excellent date and time modules on CPAN, including most people’s favorite, DateTime. In your heady rush for program purity and elegance, don’t think that you always have to use objects to do your work. Sometimes [...]