在 2025-8-29 22:10, Pali Rohár 写道:
Has somebody tried to measure compile time or other metric of mingw-w64 with and without the WIN32_LEAN_AND_MEAN under clang or gcc? I'm just curious.
Using this project: https://github.com/lhmouse/mcfgthread and this configuration: meson setup -Ddebug=true -Doptimization=s build_releaseThis can be built native Ninja in MSYS2. There is `#define WIN32_LEAN_AND_MEAN 1` and `#define NOMSG 1` in the precompiled header (mcfgthread/xprecompiled.h), which may combine to four setups:
1. Without `WIN32_LEAN_AND_MEAN` or `NOMSG`. Without precompiled header. This setup causes <windows.h> to be compiled with every C file, and takes 2.01 seconds to finish (without tests) on my computer. 2. With `WIN32_LEAN_AND_MEAN` and `NOMSG`. Without precompiled header. This setup causes a lean subset of <windows.h> to be compiled with every C file, and takes 1.75 seconds to finish (without tests) on my computer. 3. Without `WIN32_LEAN_AND_MEAN` or `NOMSG`. With precompiled header. This setup causes <windows.h> to be precompiled, thrice for the three libraries in parallel, before other source files are compiled, and takes 2.00 seconds to finish (without tests) on my computer. Meson doesn't seem to be allow a PCH to be shared by two DLLs. This shows little advantage about PCH, but I think it's because the total number of source files is low. 4. With `WIN32_LEAN_AND_MEAN` and `NOMSG`. With precompiled header. This setup causes a lean subset of <windows.h> to be precompiled, and takes 1.70 seconds to finish (without tests) on my computer. -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
