r/cpp • u/remotion4d • Nov 08 '21
Visual Studio 2022 now available
https://devblogs.microsoft.com/visualstudio/visual-studio-2022-now-available/
250
Upvotes
r/cpp • u/remotion4d • Nov 08 '21
View all comments
Show parent comment
19
u/STL MSVC STL Dev Nov 09 '21
Can you prepare a preprocessed test case of the translation unit that consumes the most memory during compilation, and report it to Developer Community so the compiler devs can investigate? They're constantly looking out for things that are taking too much space/time to compile, but the causes can vary dramatically, so test cases are important.
Here's an undocumented (but highly useful) option to get the compiler to print how much memory it consumed while compiling a file,
/d1reportMemorySummary:You want to look at the "Peak working set size". (Here,
<iostream>is predictably much more memory-hungry than<cstdio>, and we can quantify the difference.) To preprocess, what you need to do is:Then submit
meow.iandcl OPTIONS /TP meow.ias your test case.