Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

GCC is Slow

Name: Anonymous 2017-04-11 9:53

Why compiling single C++ file takes minutes?

Name: Anonymous 2017-04-11 9:55

Name: Anonymous 2017-04-11 9:56

That is because GCC is obsolete software. You're supposed to use Clang.

Name: Anonymous 2017-04-11 10:06

I heard the reason GCC is so shitty is because RMS made it that way to make sure others can't connect proprietary backends/frontends with it.

Name: Anonymous 2017-04-11 11:38

>>3
clang is even slower

Name: Anonymous 2017-04-11 12:05

>>5
try mingw

Name: Anonymous 2017-04-11 12:43

http://stackoverflow.com/questions/318398/why-does-c-compilation-take-so-long
In C#, List<T> is the only type that is compiled, no matter how many instantiations of List you have in your program. In C++, vector<int> is a completely separate type from vector<float>, and each one will have to be compiled separately.

Add to this that templates make up a full turing-complete "sub-language" that the compiler has to interpret, and this can become ridiculously complicated. Even relatively simple template metaprogramming code can define recursive templates that create dozens and dozens of template instantiations. Templates may also result in extremely complex types, with ridiculously long names, adding a lot of extra work to the linker. (It has to compare a lot of symbol names, and if these names can grow into many thousand characters, that can become fairly expensive).

And of course, they exacerbate the problems with header files, because templates generally have to be defined in headers, which means far more code has to be parsed and compiled for every compilation unit. In plain C code, a header typically only contains forward declarations, but very little actual code. In C++, it is not uncommon for almost all the code to reside in header files.

Name: Anonymous 2017-04-11 13:35

>>5
But that's not true!

Name: Anonymous 2017-04-11 13:36

>>7
Wrong, a C++ implementation is free to have a single compiled vector<T>.

Name: Anonymous 2017-04-11 14:01

>>9
implying GCC folk read standards they implement

Name: Anonymous 2017-04-11 16:22

>>10
Whom are you quoting?

Name: Anonymous 2017-04-12 11:49

>>1
Sepples Templates fan?

Name: Anonymous 2017-04-13 1:32

>>1
Parsing C++ is literally an undecidable problem.

>>6
MinGW is literally just GCC for Windows. Unless the speed problems are due to I/O or executable format (which they're not) it won't lead to a speed increase.

Name: Anonymous 2017-04-17 21:03

Serves him right, he trusted Ricardo Stallman!

Name: Anonymous 2017-04-18 2:07

Gopher says hi.

Name: Anonymous 2017-04-18 8:57

>>15
Hello Gopher

Name: Anonymous 2017-04-19 2:29

GCC is pronounced Gucci.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List