Many times upon profiling the code as recommended by dragonchild, you'll find that just a few segments of code are your bottlenecks. In some instances, the only solution is to code them in C, but more often than not, rethinking the design can save you a lot of execution time without dropping into C.
For example, hash lookups are faster by a long shot than grepping a list, if the dataset is large. Maybe nested foreach loops can be replaced by a smarter algorithm that doesn't require so much nested looping. Perhaps database inserts can be done in larger transactions, only committing after 1000 rows, instead of committing individual rows. The list goes on and on. Before looking for a lower level language, first look to see if you're getting the most out of your higher level language. An inefficient algorithm written in Perl will still be inefficient in C.
Dave
In reply to Re: Packages to make perl code go faster?
by davido
in thread Packages to make perl code go faster?
by EchoAngel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |