=encoding euc-jp =head1 NAME =begin original perlperf - Perl Performance and Optimization Techniques =end original perlperf - Perl の性能と最適化のテクニック =head1 DESCRIPTION =begin original This is an introduction to the use of performance and optimization techniques which can be used with particular reference to perl programs. While many perl developers have come from other languages, and can use their prior knowledge where appropriate, there are many other people who might benefit from a few perl specific pointers. If you want the condensed version, perhaps the best advice comes from the renowned Japanese Samurai, Miyamoto Musashi, who said: =end original これは、perl プログラムへの個々の参考として使える性能と最適化の テクニックの使用の紹介です。 多くの perl 開発者は他の言語から来ていて、適切な場所では以前の知識を 使えますが、いくつかの perl 特有の点から利益を得られるかもしれない多くの 人もいます。 要約版がほしいなら、おそらく最良のアドバイスは、有名な日本の侍である 宮本武蔵の言葉でしょう: =begin original "Do Not Engage in Useless Activity" =end original 「役に立たないことをしないこと」 =begin original in 1645. =end original と 1645 年に記しています。 =head1 OVERVIEW (概観) =begin original Perhaps the most common mistake programmers make is to attempt to optimize their code before a program actually does anything useful - this is a bad idea. There's no point in having an extremely fast program that doesn't work. The first job is to get a program to I do something B, (not to mention ensuring the test suite is fully functional), and only then to consider optimizing it. Having decided to optimize existing working code, there are several simple but essential steps to consider which are intrinsic to any optimization process. =end original おそらくプログラマが犯す最もよくある間違いは、プログラムが実際に有用な ものになる前にコードを最適化しようとすることです - これは悪い考えです。 うまく動かないすごく高速なプログラムには意味がありません。 最初の仕事はプログラムが I<正しく> 何か B<有用なこと> をするようにして (テストスイートが完全に機能することを保証するという意味ではありません)、 それからそれを最適化することだけを考えます。 既に動作するコードを最適化すると決めたら、あらゆる最適化プロセスに内在すると 考えられる、いくつかの単純だけれども本質的なステップがあります。 =head2 ONE STEP SIDEWAYS (一歩横に) =begin original Firstly, you need to establish a baseline time for the existing code, which timing needs to be reliable and repeatable. You'll probably want to use the C or C modules, or something similar, for this step, or perhaps the Unix system C