in reply to Speeding up a Perl code. Can it be faster?

Install the Perl module from CPAN, Devel::NYTProf, write a test script that invokes this subroutine, and then profile it. I would not suggest using NYTProf on code that also uses Benchmark -- just write a script that invokes the subroutine a few times with varying but realistic data and run it through the profiler.

By doing this you'll gain a better appreciation for where the hotspots are. Without doing this, we really have to just use intuition, which is not as reliable as real data.


Dave

  • Comment on Re: Speeding up a Perl code. Can it be faster?