Le 11 mai 2013 à 12:40, Marc Joliet <mar...@gmx.de> a écrit :

> Am Sat, 11 May 2013 12:02:45 +0200
> schrieb Stéphane Letz <l...@grame.fr>:
> 
>>> 
>>>> Then we know that the resulting C/C++ code can be quite large and 
>>>> sometimes push the C compilers to their limits… It some sense the Faust 
>>>> compiler does produce completely "inlined" code that can be quite huge. 
>>>> There is still a lot of work to do in the quality of this code, so that 
>>>> for instance to better share common code that is applied on different 
>>>> datas, these kind of things... 
>>> 
>>> Yes, I use both GCC and Clang here, and Clang handles the code that FAUST
>>> produces *much* better than GCC.  In the case of my project, g++ alone could
>>> take several minutes (>10 I think?) and have peak memory use of over 2G (!),
>>> while clang++ compiles much faster (a few seconds), uses much less RAM *and*
>>> produces better code (when the code is vectorised, that is).
>> 
>> Yes, it is well known that Clang beats GCC in this area.. But GGC is still 
>> better at auto-vectorization right?
>> 
>> (AFAICS clang still has very limited form of auto-vectorization …)
> 
> Almost two years ago I was trying out LV2 and wrote a peaking EQ following the
> EQ cookbook.  To benchmark it, I let it filter 48000 samples of audio.  At 
> that
> point, GCC beat Clang by a few ms (something like 20 ms for gcc vs. 23 ms for
> clang). After learning about auto-vectorisation, I split the filter loop into
> the recursive and non-recursive parts, with no other modifications to the 
> code.
> Suddenly, Clang *beat* GCC by a few ms (now something like 18ms for gcc vs. 
> 15ms
> for clang). So my conclusion at the time was: clang is better with vectorised
> code, while GCC is better with scalar code.
> 
> [ Aside: I know that if you write C/C++ by hand you can give GCC hints about
>  your code (stuff like memory alignment, etc.), in which case it will
>  produce very good, compact vectorised code. ]
> 
> Now, in the case of my Regalia-Mitra-Project, I'll just quote my README:
> 
>    NOTE: it turns out that on my computer (AMD Athlon64 X2 4200+ from late
>    2006) clang++ produces faster binaries than g++. MBStereophony uses about
>    15% CPU on average when compiled with g++ (with CFLAGS="-O3
>    -march=native"), while it only uses about 9% CPU on average when compiled
>    with clang++.
> 
> This is, of course, with vectorisation. And for completeness: I use clang-3.1
> (with llvm-3.1).
> 
> So I believe that Clang *is* better at auto-vectorisation than GCC and has 
> been
> for a while now, or are my observations too simplistic?

Without looking precisely at the generated assembly code I would not be sure 
((-;

Stéphane
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to