Last active
December 21, 2019 12:10
-
-
Save KeenS/46ac6a17d891da5defe57e26b147057c to your computer and use it in GitHub Desktop.
Rustの並列コンパイラを試してみた See also https://qiita.com/qnighy/items/b0aa66749ad7a31ecbf9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
手元のコード(4万行くらい)をThreadripper 1950x(16コア32スレッド)でビルドしてみた | |
# 並列化してないやつ | |
cargo +nightly-2019-12-17 build 882.25s user 49.92s system 468% cpu 3:19.16 total | |
cargo +nightly-2019-12-17 build --release 2988.11s user 52.70s system 1149% cpu 4:24.54 total | |
cargo +nightly-2019-12-17 check 199.58s user 14.22s system 413% cpu 51.731 total | |
# 並列化したやつ | |
cargo +nightly-2019-12-18 build 1061.89s user 75.08s system 618% cpu 3:03.70 total | |
cargo +nightly-2019-12-18 build --release 3135.03s user 74.32s system 1247% cpu 4:17.21 total | |
cargo +nightly-2019-12-18 check 283.43s user 25.87s system 951% cpu 32.496 total | |
メモ: | |
`cargo build` が10%、 `cargo build --release` が誤差程度、 `cargo check` が40%高速化している。 | |
usersを見ると使用時間が増大しているので、並列化が効いているのが分かる。CPU使用率を観察してても並列化したやつの方がCPUをよく使っていた | |
それでもあんまり高速化していないのはsystemが増えているため。要するに並列化したときの同期コストで並列化による高速化の大部分を相殺している。 | |
`build --release` については最後のリンクなどが遅いので結局並列化してもあんまり速くならないみたい。 | |
測りようがないのでやってないが、軽く動かしてみた感じrlsも並列化してるっぽい。ちゃんとは試してないけど気持ち軽くなった気がする。 | |
ひとまず `cargo check` が速くなってるので日頃の開発は速くなりそう。 | |
因みにテストを動かしてみた感じデグレなどはなさそうだった |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment