ループを分割したほうが速いのはなぜか。アラインメントとキャッシュメモリの性質とのこと。

bellbindbellbind のブックマーク 2011/12/20 22:03

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

Why are elementwise additions much faster in separate loops than in a combined loop?

    Suppose a1, b1, c1, and d1 point to heap memory, and my numerical code has the following core loop. const int n = 100000; for (int j = 0; j < n; j++) { a1[j] += b1[j]; c1[j] += d1[j]; } This loop i...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう