-
Winui3 CPP project why sometimes compilation is particularly slow Just changed one line of code and compiled it for 5 minutes, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Yes, on my OS (Windows 10 21H1, on an old PC (7 years)), all C++/WinRT projects (WinUI or not) take ages to be compiled, while the similar code in C#, VB.NET, C++/Win32 , C++/CLI is Ok |
Beta Was this translation helpful? Give feedback.
-
Console :Win32 :one (lol.cpp) file -> compiled to (.whatever) object code file. WinRT :First run : two (pch.h and lol.cpp) file -> compiled to (.whatever) object code file. NOTE : second run is as fast as win32 projects compile time. XAML (WinUI 3) :each .XAML (WinUI 3) files -> parsed and interpreted to ("iso standard cpp") *.cpp files -> compiled to (.xbf) object code files. 👉yes "compiling" WinUI 3 is a two step task and .xaml to "iso standard cpp" .cpp alone takes huge amount of time and then there's regular .cpp compilation. see microsoft/cppwinrt#660 (comment) and finally also see some VS crapiness microsoft/cppwinrt#664 (comment) |
Beta Was this translation helpful? Give feedback.
-
ok,I suspect it is the problem of vs. sometimes the CPU is not occupied when it is very slow. |
Beta Was this translation helpful? Give feedback.
Console :
Win32 :
one (lol.cpp) file -> compiled to (.whatever) object code file.
WinRT :
First run : two (pch.h and lol.cpp) file -> compiled to (.whatever) object code file.
Second run : one/only changes (lol.cpp) file -> compiled to (.whatever) object code file.
NOTE : second run is as fast as win32 projects compile time.
👉The Fix : need more mature C++ modules support in compilers. see microsoft/cppwinrt#847 (comment)
XAML (WinUI 3) :
each .XAML (WinUI 3) files -> parsed and interpreted to ("iso standard cpp") *.cpp files -> compiled to (.xbf) object code files.
👉yes "compiling" WinUI 3 is a two step task and .xaml to "iso standard cpp" .cpp alone takes huge amount of time and then…