[ Branimir Maksimovic @ 12.02.2020. 05:43 ] @
https://www.agner.org/optimize/blog/read.php?i=1015

Citat:

Microsoft Visual Studio is very popular because of the user friendly IDE and excellent debugging and cross-reference features.
But Visual Studio is lagging behind on support for the latest instruction sets, and it is not the best compiler when it comes to code optimization.


The Intel compiler used to be on the cutting edge of code optimization, but now it has been overtaken by Gcc and Clang.
Intel's compiler has also lost in popularity since its hidden "Cripple AMD" function was revealed.


The open source compilers Gcc and Clang have now taken the lead.
These two compilers are very similar. Both are supporting all platforms and the newest instruction set extensions.


I have tested the different C++ compilers and listed the results in my C++ manual. The Gcc and Clang compilers are clearly the best when it comes to code optimization.
Clang is better than Gcc in several respects, but it has a tendency for excessive loop unrolling, which is a waste of code cache. I must admit that I was quite skeptical
of the LLVM/Clang project when it started, but people have put an impressive amount of work into it, and now the Clang compiler can outperform all other compilers on several measures.


Linux and Mac programmers will have no problems finding a Clang compiler. It is a little more complicated on Windows.
There are at least two ready-to-use Clang compiler versions for Windows. A Cygwin version and a Visual Studio plugin version.


Evo recimo scimarka najnoviji gcc/clang vs java
Code:

~/.../forth/sci >>> gcc-trunk -Ofast -march=native *.c -o scimarkgcc -lm                                                                                                                                                        
~/.../forth/sci >>> /home/bmaxa/clang/bin/clang -Ofast -march=native *.c -o scimarkclang -lm                                                                                                                                    
~/.../forth/sci >>> time ./scimarkclang                                                                                                                                                                                         
**                                                              **
** SciMark2 Numeric Benchmark, see http://math.nist.gov/scimark **
** for details. (Results can be submitted to [email protected])     **
**                                                              **
Using       2.00 seconds min time per kenel.
Composite Score:         2796.07
FFT             Mflops:  2367.53    (N=1024)
SOR             Mflops:  2083.18    (100 x 100)
MonteCarlo:     Mflops:   633.00
Sparse matmult  Mflops:  3855.46    (N=1000, nz=5000)
LU              Mflops:  5041.20    (M=100, N=100)
./scimarkclang  29.86s user 0.01s system 99% cpu 29.947 total
~/.../forth/sci >>> time ./scimarkgcc                                                                                                                                                                                           
**                                                              **
** SciMark2 Numeric Benchmark, see http://math.nist.gov/scimark **
** for details. (Results can be submitted to [email protected])     **
**                                                              **
Using       2.00 seconds min time per kenel.
Composite Score:         2705.82
FFT             Mflops:  2207.41    (N=1024)
SOR             Mflops:  2128.87    (100 x 100)
MonteCarlo:     Mflops:   629.74
Sparse matmult  Mflops:  2962.38    (N=1000, nz=5000)
LU              Mflops:  5600.70    (M=100, N=100)
./scimarkgcc  35.26s user 0.00s system 99% cpu 35.325 total
~/.../forth/sci >>> java jnt.scimark2.commandline                                                                                                                                                                               

SciMark 2.0a

Composite Score: 2491.3384059536847
FFT (1024): 1562.9395627763586
SOR (100x100):   1357.0106100257588
Monte Carlo : 1374.38953472
Sparse matmult (N=1000, nz=5000): 2338.4833894485423
LU (100x100): 5823.8689327977645

java.vendor: Oracle Corporation
java.version: 1.8.0_242
os.arch: amd64
os.name: Linux
os.version: 5.6.0-2-CUSTOM




[Ovu poruku je menjao Branimir Maksimovic dana 12.02.2020. u 06:55 GMT+1]