Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #80039

Re: Have you ever noticed ...

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.lang.c++
Subject Re: Have you ever noticed ...
Date 2021-06-01 11:54 +0200
Organization A noiseless patient Spider
Message-ID <s95047$4dm$1@dont-email.me> (permalink)
References <s94f96$3pv$1@dont-email.me> <s94mij$1l4$2@gioia.aioe.org> <s94t9r$iin$1@dont-email.me>

Show all headers | View raw


On 01/06/2021 11:06, Bonita Montero wrote:
>>> If you call ...
>>> C:\Program Files (x86)\Microsoft Visual
>>> Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat
>>> ... and then ...
>>> clang --version
>>> ... then you get the nearly most recent clang (V11) with MSVC ?
>>> But unfortunately for most benchmarks I wrote MSVC generates
>>> better code than clang.
> 
>> What optimization flags did you use?
> 
> -O3
> There are also benchmarks which run faster with clang,
> but most run faster with cl.

-O3 is sometimes faster than -O2, and often slower.  Don't use -O3
unless you know what you are doing, and have tested it to see that it is
helpful for your particular requirements.  (The same applies to gcc, to
a slightly lesser extent.)

clang also has a tendency to be enthusiastic about vectorisation and
loop unrolling that can help for big data sets, but be noticeably bigger
and slower on small sets.  You see that especially on -O3, but also on
-O2.  Optimising is not just a matter of "bigger number means faster for
all tests".

(That said, MSVC can be quite efficient for some kinds of code - it's
entirely possible that it is simply better for the examples you were using.)

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Have you ever noticed ... Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-01 07:06 +0200
  Re: Have you ever noticed ... Juha Nieminen <nospam@thanks.invalid> - 2021-06-01 07:11 +0000
    Re: Have you ever noticed ... Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-01 11:06 +0200
      Re: Have you ever noticed ... David Brown <david.brown@hesbynett.no> - 2021-06-01 11:54 +0200
        Re: Have you ever noticed ... Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-01 12:25 +0200
          Re: Have you ever noticed ... Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-02 04:51 +0200
            Re: Have you ever noticed ... Doctor Who <doc@tardis.org> - 2021-06-02 05:12 +0200
              Re: Have you ever noticed ... doctor@doctor.nl2k.ab.ca (The Doctor) - 2021-06-02 04:10 +0000
        Re: Have you ever noticed ... Michael S <already5chosen@yahoo.com> - 2021-06-01 13:23 -0700
          Re: Have you ever noticed ... Real Troll <real.troll@trolls.com> - 2021-06-01 22:47 +0100
          Re: Have you ever noticed ... Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-06-01 18:24 -0700
            Re: Have you ever noticed ... Michael S <already5chosen@yahoo.com> - 2021-06-02 14:02 -0700
      Re: Have you ever noticed ... Juha Nieminen <nospam@thanks.invalid> - 2021-06-02 05:07 +0000
      Re: Have you ever noticed ... Vir Campestris <vir.campestris@invalid.invalid> - 2021-06-06 21:30 +0100

csiph-web