How do I find out why g++ takes a very long time on a particular file?

后端 未结 8 1381
日久生厌
日久生厌 2021-02-01 21:51

I am building a lot of auto-generated code, including one particularly large file (~15K lines), using a mingw32 cross compiler on linux. Most files are extremely quick, but thi

8条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 22:32

    One thing to watch during the compile is how much memory your computer has free. If the compiler allocates so much memory that the computer starts swapping, compile time will go way, way up.

    If you see that happen, an easily solution is to install more RAM... or just split the file into multiple parts that can be compiled separately.

提交回复
热议问题