With the new loading screen timing stuff in place, I’ve discovered something a little surprising.
On my computer, if I’m running in Linux, it takes about 2 seconds to parse a saved game. On the same computer running Windows, it takes almost 28 seconds. The time it takes to build the map data is basically the same, regardless of which OS is running. This is a huge surprise to me; I had always assumed that the slow part of the load was going to be building the map data… but something is really slowing down the loading of the save file itself, only on Windows, and by a lot!
Interestingly, if I run that same Windows build using Wine under Linux, it runs just as fast as the native Linux binary! The slow load only seems to happen using the Windows build if you’re actually running Windows. Which implies that the slowdown is probably happening inside a system call which is slow on Windows, and fast on Linux. There are probably lots of those. Mutexes is one common example. But parsing the save file is single-threaded; no mutexes are involved at all. So… this is going to be interesting!
I’m going to do some debugging over the next few days to try to figure this all out. There’s no good reason for the the build to be so much slower when running on Windows!