Announcement

Collapse
No announcement yet.

C++ Doesn't Change The Speed Of GCC

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


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

          Comment


          • #6
            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.

            Comment


            • #7
              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.

              Comment


              • #8
                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.

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    Originally posted by LightBit View Post
                    However, it will make compilation of GCC itself slower.
                    The article itself says not.

                    Comment

                    Working...
                    X