Topic: Linking time
jmoerschbach Topic Opener |
Posted at: 2020-05-05, 11:11
Hi, this is a somewhat technical question regarding the toolchain... On my machine (Windows 10, MSys MinGW 64, i5-9600@3.7GHz, 6 Cores, 16GB RAM) it takes 6-7min to link the final widelands executable. So developing gets really frustrating very fast because when I change only one line of code, I wait ~6min before I can see any effects. Question: Do you encounter similar times when linking or am I doing something terrible wrong (apart from being on windows instead of linux, of course... ) Is there any way we may improve this? I searched the internet but did not come up with any straight-forward solutions... I use the compile.sh like
Output is then:
I tried providing --clang and --gcc but did not see any major differences. Compiling the sources to object files is no problem at all, it is the linking. the ld process is only using one core which can clearly be seen in the task manager. But parallel linking is not supported/possible I guess. Can we do anything about it? Thanks Jonas Top Quote |
Nordfriese |
Posted at: 2020-05-05, 11:24
This is mainly a hardware problem I think. On my old machine linking initially took one hour per executable. (And that was before Does your machine have enough memory? If it uses Swap space, linking time shoots up. Other than that, I can only advise you to get a faster CPU… EDIT: Ah I see, 16 GB and not that bad CPU… perhaps MinGW is generally slow? Using linux really would be an improvement Edited: 2020-05-05, 11:26
Top Quote |
hessenfarmer |
Posted at: 2020-05-05, 12:20
Hi, Top Quote |
jmoerschbach Topic Opener |
Posted at: 2020-05-05, 13:49
wow, hessenfarmer's suggestion switchting from debug to release build reduces the link time to ~1 second (yes, from 6 minutes to few seconds Oo) Could have tried that before... That's what I'm talking about Of course, this way I cannot debug but I think I will still be much more productive just because I have so many more tries/time slot^^ Would like to know if the difference between debug vs release linking time is on your machine as significant as on my machine... Also, does anybody have more in-depth knowledge why the difference is so big? Some valid explanations/hypothesis? Top Quote |
hessenfarmer |
Posted at: 2020-05-05, 13:53
It is, as I have a comparable setup. Normally for testing if it works I do release builds. For chasing errors I insert debug logs in the code providing me information which are printed in release as well. Only to test some lua issues i use a debug as we have the lua debug console in it.
I think TinoM and GunChleoc might know in depth why this is the case. Edited: 2020-05-05, 13:53
Top Quote |
Nordfriese |
Posted at: 2020-05-05, 14:05
Wow On my machine the difference is like 1 min (release) to 2 mins (debug)… Top Quote |
hessenfarmer |
Posted at: 2020-05-05, 14:39
That is corresponding to the values in Travis. to some extent and 32 bit appveyor as well. (x64 in Appveyor is artificially long due to not having much Ram there and therefore not linking in parallel at all) Top Quote |
Tibor |
Posted at: 2020-05-05, 14:40
Just watch your swap space usage before, during and after linking. I have 8 GB RAM and prefer to compile in 2 or even 1 thread to avoid RAM issues during linking... Top Quote |
hessenfarmer |
Posted at: 2020-05-05, 14:45
Yes nice graphs to watch in Windows Task Manager. I have 16 GB and it is possible to use all cores for compiling as there aren't that many parallelm linking jobs but in the end it really needs nearly all of my 16GB for linking all the exe files. Top Quote |