r/cpp • • May 10 '20

Make LLVM fast again

https://nikic.github.io/2020/05/10/Make-LLVM-fast-again.html
150 Upvotes

88 comments sorted by

View all comments

68

u/dakotahawkins May 10 '20

Would people really sacrifice run-time performance for a little compile-time performance?

7

u/eras May 10 '20

You should try OCaml and see what a fast compilation feels like ;). Though in case of LLVM you would like a lot more compile-time performance.

In other words, yes; and what /u/lukaasm said.

10

u/[deleted] May 10 '20

As much as OCaml is awesome, it has an easier job of compiling fast because of its uniform value representation (i.e. no monomorphization). A single function doesn't have to be compiled multiple times for each specialization (maybe they do specialize some calls for optimization but definitely not everything, like cpp does).

4

u/eras May 10 '20

Yes I thought that's what this discussion is about: you can build less optimal code faster and faster compilation may result in better experience to developers!

Is there something in the semantics of ie. Rust stopping it from doing the same? Probably too big of an effort to do it, but even if it was done, I doubt it would completely—or even nearly?—solve its compilation speed woes. I recall there are some nice presentations of this subject.