If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

C++ Doesn't Change The Speed Of GCC

Phoronix: C++ Doesn't Change The Speed Of GCC

With GCC 4.8 using C++ as its implementation language of the compiler, some have questioned whether the compiler is as fast as when written in C. Here's some benchmarks showing C vs. C++ performance with GCC...

The switch to c++ wasn't about immediate speed benefits though. It was about cleaning up code and not reinventing the wheel with ideas and design because c++ had them and plain c didn't. So the fact they are even bringing this topic UP...is moot

The switch to c++ wasn't about immediate speed benefits though. It was about cleaning up code and not reinventing the wheel with ideas and design because c++ had them and plain c didn't. So the fact they are even bringing this topic UP...is moot

A lot of people (read: idiots) thought that using C++ would make GCC slower, and hence that it should be avoided.

It's like the people here who claim all that matters is the speed of compiled binaries, which as a (game) developer is one of the last things on my mind, but people perpetrate myths about what the purpose of a compiler is. A compiler is a tool, and the easier it is to use that tool, the better it is.

C++ isn't inherently slower than C. Especially with C code compiled as c++ using a few token C++ features. The fun starts when C++ is used to overengineer a piece of software, not unlike most Java code I've seen. That's not the language's fault but a problem with the coder. C just doesn't scale quite as easily.

Where exactly is the c++ implementation? I downloaded 4.8 and I still see only .c files, except ofcource libstdc++ and libjava.

"C++ implementation" may be misleading. What actually happens is that now GCC code base can be compiled using C++ compiler and new functionalities can be implemented using approved C++ features, as well as some code clean up. So there are still lots of C code, which won't be changing unless necessary.

"C++ implementation" may be misleading. What actually happens is that now GCC code base can be compiled using C++ compiler and new functionalities can be implemented using approved C++ features, as well as some code clean up. So there are still lots of C code, which won't be changing unless necessary.

Which also renders the blog referenced in this news moot: Migrating to C++ for implementation is not about immediate improvement, but long term benefits.

Where exactly is the c++ implementation? I downloaded 4.8 and I still see only .c files, except ofcource libstdc++ and libjava.

gcc/hash_table.* for instance already uses C++. Not every abstraction that GCC uses (which essentially emulates C++ via C) will be converted to C++ native equivalents but a significant number of them might be.