Page 1 of 3 123 LastLast
Results 1 to 10 of 27

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

  1. #1
    Join Date
    Jan 2007
    Posts
    14,302

    Default 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...

    http://www.phoronix.com/vr.php?view=MTMzMzc

  2. #2
    Join Date
    Aug 2012
    Location
    Pennsylvania, United States
    Posts
    1,859

    Default

    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

  3. #3
    Join Date
    Nov 2007
    Posts
    1,024

    Default

    Quote Originally Posted by Ericg View Post
    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.

  4. #4
    Join Date
    Mar 2008
    Posts
    205

    Default

    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.

  5. #5
    Join Date
    Nov 2008
    Posts
    147

    Default

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

  6. #6
    Join Date
    Mar 2013
    Posts
    2

    Default

    Quote Originally Posted by zoomblab View Post
    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.

  7. #7
    Join Date
    Mar 2013
    Posts
    2

    Default

    Quote Originally Posted by manphiz View Post
    "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.

  8. #8

    Default

    Quote Originally Posted by zoomblab View Post
    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.

  9. #9
    Join Date
    Mar 2010
    Location
    Slovenia
    Posts
    389

    Default

    Quote Originally Posted by elanthis View Post
    A lot of people (read: idiots) thought that using C++ would make GCC slower, and hence that it should be avoided.
    However, it will make compilation of GCC itself slower.

  10. #10
    Join Date
    Jun 2011
    Posts
    818

    Default

    Quote Originally Posted by LightBit View Post
    However, it will make compilation of GCC itself slower.
    The article itself says not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •