Announcement

Collapse
No announcement yet.

Ruby Compiled With Clang Is Noticeably Faster Than GCC

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

  • Ruby Compiled With Clang Is Noticeably Faster Than GCC

    Phoronix: Ruby Compiled With Clang Is Noticeably Faster Than GCC

    While in our benchmark runs the performance of generated binaries between GCC and LLVM's Clang C/C++ compilers are generally quite close, there are exceptions. When it comes to real-world usage of Clang, most companies tend to just utilize Clang for now when producing debug builds due to its faster compile times and better diagnostics than GCC, but GCC still ends up getting used for producing release/production builds...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    awesome!

    awesome!
    The real awesomeness is that ruby got roughly 36% (44-8) faster with gcc 4.9.2 compared to 4.7.2!
    gcc 4.7.0 was released on 2012-03-22, 2012... was like llvm/clang 3.2 (not sure just guessing)? I wonder how they compare.
    And would be great to mention the target cpu/host, without them those benchmarks are not very useful...

    NOTE: I know the 36% are not very "accurate"... but just for the heck of it

    Comment


    • #3
      makes me wonder if python would be faster with clang too.

      Comment


      • #4
        unfair version comparaison

        What would be interesting is to compare either versions from distrib or both versions updated
        using one latest version to compare with old versions seems methodologically wrong and unfair to gcc

        https://packages.debian.org/wheezy/clang -> version 3.0
        https://packages.debian.org/wheezy/gcc -> 4.7.2

        http://www.llvm.org/ -> version 3.5
        obviously, the version 3.5 is expected to be better.
        https://gcc.gnu.org/ -> 4.9.2

        https://packages.debian.org/jessie/gcc -> 4.9.1
        https://packages.debian.org/jessie/clang -> 3.5

        so one version from wheezy is compared to one version from jessie...

        incoming future version in 2015 like gcc 5.0 (and clang) could also change things a lot...

        So I would conclude that upgrading either complier may be a good idea to improve Ruby efficiency.

        Comment


        • #5
          While it's great that it is indeed faster, 8% is not a lot. In fact, anything under 10% is largely unnoticable.

          And comparing Clang 3.5 vs GCC 4.7 in Wheezy is quite disingenuous, considering Wheezy ships with Clang 3.0.

          I like Clang/LLVM and GCC both and it's great that the competition is improving developer's (including my own) lives, but let's compare them fairly. No need to be over-zealous, unless you're pushing an agenda...

          Comment


          • #6
            Faster?

            But what does he measure? Timings? Number of requested processed? ...

            He just says 8% faster. It's a meaningless statement without knowing what he measured and how.

            Comment


            • #7
              I would bet that the difference is LTO and cross-module optimization. Clang does this automatically. Setting up the Ruby build to use GCC's LTO might be a bit of work, but it'd be an interesting test.

              Comment


              • #8
                Ruby is my day job and performance can be an issue so this is certainly good news. It's usually better threading performance that is really needed though and MRI will still suffer from the Global Interpreter Lock regardless of which compiler it was built with. We're currently switching some our of deployments to Rubinius for this reason. I wonder whether that would see similar boosts.

                Comment


                • #9
                  Originally posted by adler187 View Post
                  While it's great that it is indeed faster, 8% is not a lot. In fact, anything under 10% is largely unnoticable.

                  And comparing Clang 3.5 vs GCC 4.7 in Wheezy is quite disingenuous, considering Wheezy ships with Clang 3.0.

                  I like Clang/LLVM and GCC both and it's great that the competition is improving developer's (including my own) lives, but let's compare them fairly. No need to be over-zealous, unless you're pushing an agenda...
                  8% is a lot when performance is the only reason people still use your compiler.

                  Comment


                  • #10
                    make benchmark?

                    I tried to compare GCC 4.9 built ruby with one built with clang version 3.6.0 (trunk 219925clang version 3.6.0 (trunk 219925) with default options (i.e. binary is built with -O3).
                    Ruby comes with benchmark run via "make benchmark". Geomavg of speedups of clang is 0.933, so clang seems about 7% slower.



                    I will give LTO a try.

                    Comment

                    Working...
                    X