February 14, 2013 | Dukus | No Comments
I've always had issues with games that have long load times. Especially ones where you end up loading more often than not because of mistakes, failure, and death. This goes triple if you're writing a game. I start and stop the game 50 times a day while coding and debugging. My game hasn't been having fast load times. When I started writing the game I wrote a bunch of code knowing it would help with this issue: Because I had done all these things, I started to become disconcerted at the speed at which the game took to start. From prior experience, I know a modern hard disc can read 100M in under a second, and the data for the game is just under that. My philosophy for optimization is to write good code, and not worry about how fast it runs until I actually notice the game running slowly. So when load times got to be around thirty seconds I noticed, and properly investigated with a code profiler. It turned out the primary thread that is rendering the loading screen wasn't giving up it's execution time while waiting for the monitor v-sync to occur. The loading thread was executing less than 3% of total CPU time. This made all my good code run just once in a while. Fixed that, and now the loading time is now under 2 seconds. Guess I did things right. Mostly. Phew.