|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Optimize Perl
by Corion (Patriarch) on Oct 22, 2004 at 07:00 UTC | |
What I get from skimming this article, it's just obsessing around premature optimization and small techniques to shave off "hundreds of microseconds or even whole seconds" from the runtime of programs. It doesn't mention Benchmark.pm, it does mention the profiler only in passing, and it doesn't mention the fact that optimizing/changing your algorithm to a better suited algorithm will most likely give a much bigger gain than any string concatenation optimization. The one article about hardcore optimization of Perl code is When Perl is not quite fast enough by Nicholas Clark, and the IBM article doesn't go that way. I am not really fond of these drive-by article spammings by the IBM Developerworks, and I'd prefer if IBM Developerworks offered a subscriber method so that the folks interested in the articles can be notified without "Perl News" also being spammed by this. Update: On second reading, the author mentions what perlcc does. I still wonder what the sense is, at it only reduces startup time, which is negligible for long-running processes. | [reply] |
by Zed_Lopez (Chaplain) on Oct 22, 2004 at 20:33 UTC | |
I'll also recommend Introduction to Code Turning from Code Complete 2. It's talking about C, but the principles are generic. | [reply] |
Re: Optimize Perl
by ihb (Deacon) on Oct 22, 2004 at 08:19 UTC | |
I didn't like that article a bit. If you want to improve the performance of your Perl program Perl Monks is a much better resource. If I recall correct there has been nodes about this before. (Update: or see When Perl is not quite fast enough as Corion pointed out.) By the way, in this example, an even quicker way of producing a string that repeats the alphabet 999,999 times would be to use: It must be rather embarrassing to make this obvious mistake that no one that writes an article about Perl should make. A bit further down the article I read "Better still, in a simple calculation like this one or for any straightforward loop work, use map:", and then the author uses map BLOCK in void context instead of a for loop. Overlooking style issues it's still not a very good advice to me: From there on, I didn't give the article much credibility nor read it too closely. I did notice some either ignorant or poorly expressed statements, but I won't even bother elaborating. Update: Although it raised some valid points it didn't elaborate when necessary -- I find it far too "simple". ihb
See perltoc if you don't know which perldoc to read! | [reply] [d/l] [select] |
by castaway (Parson) on Oct 22, 2004 at 08:34 UTC | |
C. | [reply] |
Re: Optimize Perl
by zentara (Cardinal) on Oct 22, 2004 at 11:59 UTC | |
Also I'm glad that IBM is putting out articles discussing the workings of Perl, so I wouldn't go there to downvote it. Any article which induces "Perl thoughts" is good. :-) I'm not really a human, but I play one on earth. flash japh | [reply] |
by rcaputo (Chaplain) on Oct 24, 2004 at 20:32 UTC | |
IBM publishes some fine free resources. I hope they keep doing it. Some of the little things we should watch out for are correctness and completeness, especially from someone who has written Debugging Perl. Factual errors and omissions are embarassing. I'm sure he didn't make them on purpose, which makes downvoting and including constructive comments all the more important. Nobody learns from mistakes they aren't aware they've made. -- Rocco Caputo - http://poe.perl.org/ | [reply] |