3

アセンブリで算術整数ライブラリを作成しました。プロセッサ(Intel Sandy Bridge)のピークパフォーマンスと比較したパフォーマンスを見積もりたいと思います。

SandyBridgeの3つのALUによって整数演算が実行されるので、「3 *(コアの数)*周波数」は見積もりを取得するのに十分ですか?私のアセンブリの99%はaddq, adcq, mulq指示です)。

4

2 に答える 2

1

No.

There are many factors that influence the speed of any code. Things like dependencies between instructions that cause stalls, cache accesses and cache speed, cache misses and RAM speed, etc.

For Sandy Bridge specifically, there's also hyper-threading (those ALUs are shared by 2 logical CPUs) and turbo-boost and power management. Then there's paging (TLB lookup, and TLB misses).

On top of all that there's OS overhead; including things like how quickly the kernel can resolve page faults (for various "copy on write" and "allocate on write" purposes), how all work is scheduled across CPUs, how many task switches occur and how fast they are, how mutexes/futexes are handled, etc.

于 2012-11-09T14:10:30.377 に答える
0

8086 や 68000 のような 1980 年代のプロセッサについて話している場合、それは有効であり、各命令は固定時間で実行されます。

最新のプロセッサは、命令を高速に実行するための非常に多くのトリック、大規模なキャッシュ、パイプライン、順不同の命令実行などを引き出すため、手動でベンチマークするのが非常に困難になっています。最良の方法は、コードの時間を計ることです。ベンチマークを実行するときは、他のコアで実行されているコードの影響も考慮する必要があります。最新の i7 チップのように、プロセッサの全体的な負荷に応じて、プロセスをさまざまな速度で実行できます。

于 2012-11-09T14:09:35.107 に答える