in reply to How Perl Optimize your code & some code TIPS ;-P
There are a number of problems with this node's suggestions. First of all, as at least one other person has pointed out, code readability is really important, and generally more important than "writing fast code".
When speed is important, the two most important tools in a developer's arsenal are profiling (Devel::DProf) and benchmarking (Benchmark.pm). Profiling lets you find the biggest bottlenecks and focus on them. Benchmarking tells you if you're making any noticeable difference.
Simply "writing faster code" is pointless. Some code paths are travelled very infrequently, so optimizing them is silly. The same holds true with optimizing things like failure reporting (at least for most applications).
Moreover, experience tells me that what ends up being slow is often unpredictable, and also often localized. So again, there's no point in trying to micro-optimize everything. If 50% of your app is spent in 5% of its code, then making every part of your app 10% faster is time wasted if you could double the speed of that 5%.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How Perl Optimize your code & some code TIPS ;-P
by gmpassos (Priest) on Jan 25, 2003 at 07:08 UTC |