1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

M1 で llvm ビルド時間のメモ

Last updated at Posted at 2020-12-14

背景

M1 CPU(Apple Silicon)での C++ コンパイル性能を知りたい.

llvm(llvm-project) をビルドしてみます.
(llvm のみ. libclang などのビルドは行わない)

手順

2020/12/14 時点の llvm-project master

$ mkdir build && cd build
$ CXX=clang++ CC=clang cmake -G Ninja ../llvm

結果

総ファイル数は 2985 個くらいです.

x86 は Ryzen9 3950X と比較しました. 完全に同じ構成ではありませんが参考になるでしょう.

  • clang10 + 96 GB mem + NVMe + Ryzen9 3950X(16 cores)
    • 6 分 52 秒
  • 16 GB mem + 256 GB storage + 2020 Macbook Air(CPU 8 cores)
    • 18 分 54 秒
  • 16 GB mem + 256 GB storage + 2020 M1 mac mini
    • 11 分!
    • ninja 4831.54s user 178.10s system 758% cpu 11:00.60 total
  • clang10 + 16 GB mem + NVMe + Jetson AGX Xavier(aarch64 linux. 8 cores)
    • bfd だとリンク失敗するので, リンカには LLD を利用. -DLLVM_ENABLE_LLD=On`
    • ninja -j 8 でビルド
    • 42 分 32 秒(うち sys 13m56.448s)

LLVM のビルドは完全並列にできるわけではありませんが, m1 macbook air(2020) は 3950X の 1/2.7 の性能となかなかかと思います.

M1 mac mini(2020) はフル性能が出せるからでしょうか, 11 分とかなり改善があります.
8 cores Ryzen あたりとの比較だと M1 mac mini のほうがコンパイル早いかもですね.

M1 は Jetson AGX の 2.2 倍くらいと良いですね.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?