ビジネス WinDbg入門 すぐ落ちるWinDbgコードを書きましょう!


CPU性能とアプリケーション開発者

Herb Sutter氏のこの論文を紹介する第5回目は次の段落を取り上げます。まずは原文と訳文(要点訳)をご覧ください。

If you’re a software developer, chances are that you have already been riding the “free lunch” wave of desktop computer performance. Is your application’s performance borderline for some local operations? “Not to worry,” the conventional (if suspect) wisdom goes; “tomorrow’s processors will have even more throughput, and anyway today’s applications are increasingly throttled by factors other than CPU throughput and memory speed (e.g., they’re often I/O-bound, network-bound, database-bound).” Right?

Right enough, in the past. But dead wrong for the foreseeable future.

The good news is that processors are going to continue to become more powerful. The bad news is that, at least in the short term, the growth will come mostly in directions that do not take most current applications along for their customary free ride.

Over the past 30 years, CPU designers have achieved performance gains in three main areas, the first two of which focus on straight-line execution flow:

clock speed

execution optimization

cache

Increasing clock speed is about getting more cycles. Running the CPU faster more or less directly means doing the same work faster.

Optimizing execution flow is about doing more work per cycle. Today’s CPUs sport some more powerful instructions, and they perform optimizations that range from the pedestrian to the exotic, including pipelining, branch prediction, executing multiple instructions in the same clock cycle(s), and even reordering the instruction stream for out-of-order execution. These techniques are all designed to make the instructions flow better and/or execute faster, and to squeeze the most work out of each clock cycle by reducing latency and maximizing the work accomplished per clock cycle.

Finally, increasing the size of on-chip cache is about staying away from RAM. Main memory continues to be so much slower than the CPU that it makes sense to put the data closer to the processor and you can’t get much closer than being right on the die. On-die cache sizes have soared, and today most major chip vendors will sell you CPUs that have 2MB and more of on-board L2 cache. (Of these three major historical approaches to boosting CPU performance, increasing cache is the only one that will continue in the near term. I’ll talk a little more about the importance of cache later on.)

この段落の要点は次の通りです。
アプリケーション開発者の多くは、これまで通り、タダの昼飯にありつけると考えている。つまり、CPUとメモリの動作スピードの向上はそのまま自分たちのアプリケーションのパフォーマンスを改善してくれると信じ切っている。結論を急げば、その認識を改める時代が入った。

プロセッサー性能は今後も向上するだろう。しかし、向上(昼飯)の意味は変わった。昼飯はタダで手に入る時代は過ぎ去り、それなりの対価を支払う必要が出てきた。今後は、プロセッサー性能が向上しても、現在のアプリケーションに手を加えない限り、その向上の恩恵にありつけない。

この30年の間、CPU設計者たちは次の3の視点からパフォーマンス改善に努めてきた。

クロックスピード(半導体技術 => 処理の高速化)

命令実行の最適化(回路設計 => 処理量の増大)

キャッシュ(回路実装 => メモリアクセスの削減)


この段落には、パイプライン、分岐予測、複数命令の同時実行、命令ストリームの再構成などの用語が含まれています。筆者の書庫を見ると、「PowerPC Reference Patform Specification Version 1.0」、「PowerPC Tools」、「PowerPC 603 RISC Microprocessor User's Manual」などといった出版物があります。これらの出版物は、ある作業のために、IBMの関係者から渡されたものでした。いずれの出版物にもIBMとMotorolaの名前が記されています。そして、ページを開くと、パイプライン、分岐予測、複数命令の同時実行、命令ストリームの再構成などの用語がすでに使われています。

書物の出版年は、1994年となっています。1994年といえば、C/C++の弱点を徹底的に突いたJavaが発表される前年、MS-DOSの匂いを放つ最後のWindows OSと言われた、あのWindows 95が発表される前年にあたります。さらにいえば、MicrosoftとNetscape間のブラウザ覇権争いが激化する直前ということになります。1995年以降、開発現場は3階層Webアプリケーション開発一色になり、UML、OOP、上流設計、データベース、スクリプト、仮想マシンなどといった用語が一躍表舞台に登場します。ITバブルの始まりです。

今後は、プロセッサー性能が向上しても、現在のアプリケーションに手を加えない限り、その向上の恩恵にありつけない。この文はいったいどのような意味を持っているのでしょうか。いよいよ核心部分に入るようです。

前へ | 次へ


 WinDbgスクリプティング講座  ホーム


Copyright©豊田孝 2004- 2008
本日は2008-12-04です。