Skip to content

Instantly share code, notes, and snippets.

@Voultapher
Created July 16, 2018 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Voultapher/5e02e38c0a76eb5493fc98dd92c79dfa to your computer and use it in GitHub Desktop.
Save Voultapher/5e02e38c0a76eb5493fc98dd92c79dfa to your computer and use it in GitHub Desktop.
rustc vs clang | llvm production

Hello, I'm interested in rustc' compile time. Some preliminary test left me with some questions.

I measured building a minimal application. https://gist.github.com/Voultapher/ebc3abb55994ea90f3ac604c5ffccc19

Things I noticed:

  • nightly is significantly faster than stable, yay!
  • clang's full run is less than emit llvm ir + compile llvm ir
  • rustc's full run is much slower than emit llvm ir + compile llvm ir

clang's full time could be explained by avoiding separate stages and using llvm as lib. However rustc taking longer than the separate stages seem weird. Maybe this is less noticeable in bigger builds and a fixed cost. What is rustc doing that is taking so much time when building an app?

Comparing it to building a library: https://gist.github.com/Voultapher/7fbcf7e307896ea557b50eff5fb0db42

clang somehow takes longer to build the library than the application. rustc is similar to clang, as long as the std modules aren't used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment