MingW: A lot of warnings + too slow compiling
-
@hskoglund said in MingW: A lot of warnings + too slow compiling:
@JKSH : so maybe you'll have to drink that beer, because my project actually builds slightly faster on Wine than on a real Windows. Admittedly not much of a difference though...
Dagnabbit! :-D
And I definitely wasn't expecting MinGW on Wine to beat native GCC on Ubuntu. Any ideas how that works?
@hskoglund said in MingW: A lot of warnings + too slow compiling:
gcc 9.3.0 on Ubuntu 20.04: 52 minutes 23 seconds
...
MSYS2 Mingw32 on Win10: 1 minute and 54 seconds...or how this works?
-
Well the difference between Wine and native gcc on Ubuntu is only about 4% so it could be due to some caching in Wine.
But as to why MSYS2 mingw and clang just kills the others I don't know. The 2 big .h files have approx. 17000 QStringLiterals each (I get very nice loading/runtime performance using QStringLiterals)
Someday I should test with say 10000 QStringLiterals etc...
P.S. To get MSVC2019 to build, I added to the .pro file for MSVC2019:
win32-msvc: QMAKE_CXXFLAGS += "/bigobj"
and it just finished:
MSVC2019 on Win7: 18 minutes and 46 seconds. Pretty good! -
Since, mingw is a gnu port to windows, It's bound to be slower on Windows than on linux
When I changed ( about 2 years ago ) from mingw to MSVC as the default compiler, my project build time was slashed by a factor of 5, consistently across all projects!
May also be due to all the shady business and corners cut that MSVC does 🤷♂️.
Microsoft does not have a good track record with compilers and compiler safety :)
-
@J-Hilk said in MingW: A lot of warnings + too slow compiling:
from mingw to MSVC as the default compiler, my project build time was slashed by a factor of 5, consistently across all projects!
This is just depressing :( Why does it achieve that? They are compilers. "Cutting corners" could surely not get even vaguely near that. There must be some fundamental architectural difference. I've been meaning to raise a topic about this for a while, I note that MSVC makes heavy use of
.pch
files andgcc
does not seem to do that at all? -
@hskoglund said in MingW: A lot of warnings + too slow compiling:
MSYS2 Mingw32 on Win10: 1 minute and 54 seconds
Wowww! So fast!!
@hskoglund Only to confirm: this test was made using MSYS2 MingW-W64 or (32 bit version)?
I am confused about how your results can be just the reverse of mine. I would expect proportional results, as we are using the same compilers, on the same OS, etc ...If you think there may be another configuration that I can change to try to get your MingW (Win10) build time, please let me know! I can try!
@hskoglund said in MingW: A lot of warnings + too slow compiling:
MSVC2019 on Win7: 18 minutes and 46 seconds. Pretty good!
With this last flag, MSVC2019 is pretty good too!
@J-Hilk said in MingW: A lot of warnings + too slow compiling:
by a factor of 5
Exactly. That's the build time difference that I have in my current project switching between theses 3 compilers.
@JonB said in MingW: A lot of warnings + too slow compiling:
MSVC makes heavy use of .pch files and gcc does not seem to do that at all?
a) Did you mean that MSVC create
*.pch
files automatically? Without an explicit developer setting?b) Even though MSVC does this, in my tests above I always cleaned the build folder completely before recompiling. So there would be no
*.pch
file to optimize compilation time. Right? -
@fem_dev
IIRC, MSVC.pch
generation/usage requires a compiler flag. We used it on our projects, it made a big difference.I assumed
gcc
did not have these, but it now appears I am incorrect --- https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html. I am surprised, then, since I have not a single example of a Qtgcc
using them. When I would have thought it would be an ideal candidate. Then again, I see https://stackoverflow.com/questions/54727653/why-is-using-precompiled-headers-on-gcc-slower ....It doesn't appear this is factor in your tests.
-
Hi, as I remember .pch files from my MFC days, they saved time when you compiled the same project over and over, but the tests in this topic are more "single-shot" flavored (i.e. you delete the build folder and .pro.user files every time). so they are immaterial here I think.
-
@hskoglund said in MingW: A lot of warnings + too slow compiling:
but the tests in this topic are more "single-shot" flavored (i.e. you delete the build folder and .pro.user files every time). so they are immaterial here I think.
Yes! That's it!
-
@fem_dev , @hskoglund
Yes, I acknowledged the.pch
is not relevant to your tests.FWIW, you might want to Google:
why is mingw so slow
, e.g. https://stackoverflow.com/questions/929495/why-is-mingw-very-slow. This is way beyond my experience, but I think it says if you're on a network (Active Directory) it behaves like a dog....! Admittedly that was over a decade ago, but who knows... :) Does https://groups.google.com/forum/#!topic/spatialite-users/PMi3sQxMAtA where it's "solved" help you?! -
@JonB said in MingW: A lot of warnings + too slow compiling:
f you're on a network (Active Directory) i
Thank you @JonB , but my Windows machine is not in any network.
No special Windows configurations. Just a cleaner Windows 10 x64 installation with default configurations. -
@fem_dev
The second post was the last resort (worth doing though!) switch any anti-virus off on Windows? That's my last thought. I am surprised by a factor as large as 5 times. Then again, @hskoglund's figures seem to vary by factor of 100x !! Surely there's something fishy here...? :) -
@JonB said in MingW: A lot of warnings + too slow compiling:
switch any anti-virus off on Windows?
In this Windows machine, I don't have anti-virus or firewall...
@JonB said in MingW: A lot of warnings + too slow compiling:
vary by factor of 100x !!
Incredible!