Re: Different compilers
Posted: Sat Jul 30, 2022 12:49 pm
Faster programs, better optimized programs, and the possibility to port your programs easily to other platforms.
http://www.purebasic.com
https://www.purebasic.fr/english/
Sounds good, Thanksjacdelad wrote: Sat Jul 30, 2022 12:49 pm Faster programs, better optimized programs, and the possibility to port your programs easily to other platforms.
Code: Select all
143 - bm3_asm_imp.exe
173 - bm3_clang_imp.exe
215 - bm3_clang_imp_opt.exe
180 - bm3_gcc_imp.exe
279 - bm3_gcc_imp_opt.exe
282 - bm3_msvc_imp_opt.exe
170 - bm3_zig_imp.exe
219 - bm3_zig_imp_opt.exe
Spec.: Intel(R) Core(TM) i7-3930K CPU @ 3.80GHz
Cores: 6, Threads: 12, Memory: 16 GBytes
GPU: NVIDIA GeForce GTX 1060 6GB
If Windows 7 is still your main operating system I can fully understand why you are reluctant to implement Zig as well.chi wrote: Sun Jul 31, 2022 10:57 am The problem with Zig is that it doesn't work on Windows 7 (and older) without a hack!
Is by any chance Et Cetera related to Peter Cetera?Et cetera is my worst enemy
skywalk wrote: Sun Jul 31, 2022 8:33 pm What are the units of the results?
ms - milliseconds
fps - frames per second
If it's ms, why is opt slower?!
Code: Select all
time = ElapsedMilliseconds() + 10000
Repeat
WindowEvent()
Paint()
counter + 1
Until ElapsedMilliseconds() > timeWindows 7 is not really the problem here, since it worked with Zig_dev10_1606 (see zip). But I was not able to compile the exe with "zig cc ..." in one run. I had to use "zig build-obj ..." to generate the PureBasic.obj and use PB's default toolchain (Pelles C porc.exe and polink.exe) to link the .libs to the .exe. Similar to PB's way of using FAsm/Gcc + porc + polink. Zig is using LLVM's Clang (clang.exe + llvm-rc.exe + lld-link.exe) with GNU/Gcc archives (.a [static library] + .so [shared object]), that are more or less Unix/Linux based (but usable on Windows with mingw64), and not with Windows' libs (.lib), which is Microsoft's native way (.lib + .dll). Purebasic on Windows is using .libs and .dlls ever since, that's why Fred is using the rest of Pelles C tool chain for creating resources (.rc), linking static/dynamic libraries (.lib) or creating import libraries (also .lib). I managed to get Zig's one shot approach (zig cc ...) down to a few errors (duplicate exports or missing export symbols), but was not able to completely solve the problem. There are many sites/forums on the internet complaining about similar experiences.fsw wrote: Sun Jul 31, 2022 9:05 pm If Windows 7 is still your main operating system I can fully understand why you are reluctant to implement Zig as well.
Lol no, it's a reference to my early childhood watching Yul Brynner's "The king and I", where he continuously said "et cetera, et cetera, et cetera" and later, in my teenage years, listening to grunge and alternative metal having a flashback with Faith No More's "Absolute Zero", where the phrase is coming fromfsw wrote: Sun Jul 31, 2022 9:05 pm BTW: Your signature says:
Et cetera is my worst enemy
Is by any chance Et Cetera related to Peter Cetera?
I can fully understand, as I cannot listen to his music for a long time either...
In case of the Plasma demo, yes! Gcc and MSVC is a good choice. MSVC wins with 3 frames more and a lesser executable size (better linking).
Code: Select all
279 - DirectX9 - bm3_gcc_imp_opt.exe
280 - DirectX11 - bm3_gcc_imp_opt.exe
239 - OpenGL - bm3_gcc_imp_opt.exe
With and without volatile and Gcc -O2 (like every .exe)
Code: Select all
200 - DirectX9 - bm3_gcc_imp_novol.exe
200 - DirectX11 - bm3_gcc_imp_novol.exe
178 - OpenGL - bm3_gcc_imp_novol.exe
Code: Select all
176 - DirectX9 - bm3_gcc_def_novol.exe
176 - DirectX11 - bm3_gcc_def_novol.exe
158 - OpenGL - bm3_gcc_def_novol.exe
Code: Select all
159 - DirectX9 - bm3_gcc_def.exe
154 - DirectX11 - bm3_gcc_def.exe
144 - OpenGL - bm3_gcc_def.exe
The one problem with it that it compiles much slower than PB ASM compiler, especially if turned on optimizations on a large code.skywalk wrote: Mon Aug 01, 2022 3:32 am So it appears gcc + opt is an excellent choice. Pity that 'volatile' is messing this up.