in reply to Optimizing Perl?
Before optimisation, it might help quite a bit finding what to optimize. Maybe the Module Devel::DProf might help you finding which subs are called how often and how much time it did. Then you could decide if there's a better algorithm, or if it's worth implementing this sub in C or the like or even using external programs which perform better for a certain problem. Or it is possible to run Tasks parallel (maybe on a multi-cpu-machine)?
Try to use good sorting algorithms, e.g. the Schwartzian Transform (or Guttman Rosler Transform) or the Orcish Maneuvre.$reverseString = reverse($string); instead of: $reverseString = join("", reverse split(//, $string);
My basic feelings about optimization are: buy a faster machine, because it often is cheaper than optimisation :-)
Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"
|
|---|