News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

What is the fastest C/C++ compiler

Started by aw27, March 17, 2019, 05:14:59 AM

Previous topic - Next topic

daydreamer

why havent you included the popular tinyc in the test?It seems its the most popular C here because it produces tiny .exes
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

TimoVJL

How this gcc 7 version works in intel?

EDIT TinyCAMD Athlon(tm) II X2 220 Processor
C compiler: gcc 7.0 patchlevel 0
Elapsed time: 23925.563880 miliseconds

CLang
AMD Athlon(tm) II X2 220 Processor
C compiler: Microsoft Visual C/C++ Version: 1600 Toolset: 160040219
Elapsed time: 31937.335960 miliseconds

AMD Athlon(tm) II X2 220 Processor
C compiler: Microsoft Visual C/C++ Version: 1916 Toolset: 191627027
Elapsed time: 37098.426560 miliseconds

AMD Athlon(tm) II X2 220 Processor
C compiler: Pelles, Version 900
Elapsed time: 39354.421960 miliseconds

C compiler: TinyC x64
Elapsed time: 72122.514480 miliseconds

C compiler: tiny C 0.9.27
Elapsed time: 77501.994200 miliseconds
May the source be with you

aw27

Quote from: daydreamer on March 18, 2019, 12:26:44 AM
why havent you included the popular tinyc in the test?
I have never used it and a bunch of others.  :redface:

Quote from: TimoVJL on March 18, 2019, 12:33:36 AM
How this gcc 7 version works in intel?
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
C compiler: gcc 7.0 patchlevel 0
Elapsed time: 8680.080000 miliseconds

felipe

that's weird...i was told (by reading an article or book, don't remember exactly) that intel's compiler was the best doing the optimization phase. are you using their pay-for-it compiler? or some kind of free trial?  :idea:

anta40

Intel used to release a "community edition" of their C++ compiler (which is unfortunately Linux only, no Windows/Mac).
Now, it seems that you either have to purchase it, or apply the education/open source contributor license.

aw27

It is a bit hidden but exists.

Free Community License
Use Intel® System Studio with a free community license backed by community forum support. This license allows you to use the software for 90 days. You can refresh the license an unlimited number of times, allowing you to use the latest version. Convert to a paid license at any time, which provides Priority Support for one year
.

aw27

Quote from: jj2007 on March 18, 2019, 12:11:48 AM

Again, it's a pity that C/C++ is such a mess - cryptic error messages all over the place...
C:\TDM-GCC-32\bin\gcc.exe  -O3 -s -o tmp.exe "Tmp.cpp" -lquadmath
____________________
Tmp.cpp:6:33: error: conflicting declaration of 'char* getcpuBrandString(char*)' with 'C' linkage
  char *getcpuBrandString(char *s);
                                 ^
In file included from Tmp.cpp:1:0:
commonHeader_1.h:11:7: note: previous declaration with 'C++' linkage
char *getcpuBrandString(char *s);
       ^
Tmp.cpp: In function 'float determinant(float*, int)':
Tmp.cpp:40:67: error: '_alloca' was not declared in this scope
   minorMat = (float*)_alloca((rows - 1)*(rows - 1) * sizeof(float));
                                                                   ^


This works:
F:\mingw-w64\i686-8.1.0-win32-dwarf-rt_v6-rev0\mingw32\bin\gcc.exe -O3 main.c helper.c -o mingw32.exe

for 64-bit:
F:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin\gcc.exe -O3 main.c helper.c -o mingw.exe

Caché GB



Determinant of Matrix using C/C++ is 109746246742754830000000.00.

Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
C compiler: gcc 7.0 patchlevel 0
Elapsed time: 8336.429293 miliseconds

Caché GB's 1 and 0-nly language:MASM

jj2007

Quote from: AW on March 18, 2019, 04:05:15 AMThis works:
F:\mingw-w64\i686-8.1.0-win32-dwarf-rt_v6-rev0\mingw32\bin\gcc.exe -O3 main.c helper.c -o mingw32.exe

for 64-bit:
F:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin\gcc.exe -O3 main.c helper.c -o mingw.exe

gcc.exe -O3 main.c helper.c -o mingw32.exe
C:\Users\Jochen\AppData\Local\Temp\ccvWYXHh.o:main.c:(.text.startup+0xc0): undefined reference to `getcpuBrandString'
collect2.exe: error: ld returned 1 exit status

aw27

Quote from: jj2007 on March 18, 2019, 05:34:37 AM
Quote from: AW on March 18, 2019, 04:05:15 AMThis works:
F:\mingw-w64\i686-8.1.0-win32-dwarf-rt_v6-rev0\mingw32\bin\gcc.exe -O3 main.c helper.c -o mingw32.exe

for 64-bit:
F:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin\gcc.exe -O3 main.c helper.c -o mingw.exe

gcc.exe -O3 main.c helper.c -o mingw32.exe
C:\Users\Jochen\AppData\Local\Temp\ccvWYXHh.o:main.c:(.text.startup+0xc0): undefined reference to `getcpuBrandString'
collect2.exe: error: ld returned 1 exit status

Now using an extremely old release to make it work for JJ  :eusa_naughty:
F:\mingw-w64\x86_64-4.8.1-release-win32-sjlj-rt_v3-rev2\bin\gcc.exe -O3 -m32 main.c helper.c -o mingw32.exe

Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
C compiler: MingW64/i686 3.0 (gcc 4.8 patchlevel 1)
Elapsed time: 8367.289800 miliseconds

64-bit:
F:\mingw-w64\x86_64-4.8.1-release-win32-sjlj-rt_v3-rev2\bin\gcc.exe -O3 main.c helper.c -o mingw.exe

Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
C compiler: MingW64/x64 3.0 (gcc 4.8 patchlevel 1)
Elapsed time: 6691.113800 miliseconds

Caché GB

On Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz

tcc32-0927.exe

Determinant of Matrix using C/C++ is -357684673432237420000000.00.

C compiler: Unknown
Elapsed time: 26079.192079 miliseconds


tcc64-0927.exe

Determinant of Matrix using C/C++ is -125780655690461880000000.00.

C compiler: Unknown
Elapsed time: 23693.694751 miliseconds
Caché GB's 1 and 0-nly language:MASM

aw27


aw27

MSVC and Intel compilers can also do Profile Guided Optimization which can boost performance in a large program. However, on small programs it can even have adverse effects. Still, I made a small test with the MSVC on my demos, results were inconclusive for the 64-bit but I noticed a little improvement of almost 5% for the 32-bit.

daydreamer

Quote from: AW on March 21, 2019, 06:59:54 PM
MSVC and Intel compilers can also do Profile Guided Optimization which can boost performance in a large program. However, on small programs it can even have adverse effects. Still, I made a small test with the MSVC on my demos, results were inconclusive for the 64-bit but I noticed a little improvement of almost 5% for the 32-bit.
after working with this http://masm32.com/board/index.php?topic=7708.0,I first turned off all optimize options and just because I was curious I tried with optimizing on
does exchanging unoptimized fpu code that only use memory locations with optimized code starts to use more fpu registers and integer code goes from almost only overuse ESP to exchange several memory located variables to use registers instead really does that much as 5%?
or fpu to SSE scalar code also?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

aw27

Quote from: daydreamer on March 24, 2019, 02:13:52 AM
after working with this http://masm32.com/board/index.php?topic=7708.0,I first turned off all optimize options and just because I was curious I tried with optimizing on
does exchanging unoptimized fpu code that only use memory locations with optimized code starts to use more fpu registers and integer code goes from almost only overuse ESP to exchange several memory located variables to use registers instead really does that much as 5%?
or fpu to SSE scalar code also?
You can ask for a listing from C/C++/Output Files/Assembler Output and see. Differences between no optimization and optimization are usually huge. However, using fpu registers or not has nothing to do with that - you select it under C/C++/Code generation/Enable Enhanced Instruction Set.