Zwift, if you care about the load time performance, I've got some free speed for you

Warning - long and ranty.

First let me say I spent way too much time down this rabbit hole. :laughing: Second, it was inspired by the many posts by @Dave_ZPCMR and his passion for having Zwift run as best as possible. Specifically what got me going was a post a week or so ago that mentioned the Zwift log file having a lot of entries in it for files that were not found. Also the many times he has pointed out that frame rates as of late have been significantly worse lately and also that it takes much longer to load than it used to. None of what I found is likely related to frame rates but I definitely think there is a lot of room for improvement in load times.

What I did was run a tool from Microsoft called “Process Monitor”. It monitors all disk and registry (and others) activity that is going on in Windows. I filtered it for executables that contain Zwift and file accesses that are in “C:\Program Files (x86)\Zwift” and below. I do this sort of thing frequently in my job so for fun fired it up against Zwift. I want to say that I’ve seen some pretty bad software activity over the years but what I found here was pretty astounding to me.

From the time that I double click on the Zwift icon, get past the launcher and pairing screen and then to the main screen (and letting it sit for a minute to do any background tasks), there were a total of 53,874 calls to the file system to read or write to files. That sounds like a lot but that number doesn’t bother me. What bothers me is that 14,787 of those calls were to files and folders THAT DO NOT EXIST! On top of that, it looks for some files hundreds or thousands of times. For example, “C:\Program Files (x86)\Zwift\data\Humans\Jerseys\Layout_normWithPocket.tga” is listed 1471 times, Layout_normWithPocket.tgax is there 1470 times and Layout_normWithPocket.ztx is also 1470 times. In all, it looks for 6,291 unique files that don’t exist. They are all things like bike frames, jerseys, trees, rocks, etc.

Once, it finally gets through all that and is sitting at the screen waiting for me to select a world, route etc it does something else that is interesting. It slowly reads “C:\Program Files
x86)\Zwift\data\Video\CritCityVid1.bik” in 128kb chunks over and over. I say slowly because it’s only a 45MB file but it takes a full minute to get through the whole file at which point, it starts over and goes through the whole file again. If you open that file in a media player it’s various videos that are sometimes seen in game like up on the big screens in Paris.

Next I monitored what happens when selecting a world and doing a fan view of someone for a while. I brought up Watopia and got more of the same. 28,381 calls to files and 9,641 of which were to non existent files of which 1,949 were unique file names. Once things were running I didn’t notice any more oddities in looking for files but I do see it occasionally loading a file for a particular asset like hats and glasses (at least it knows where to find those…). One thing I do note is that it frequently loads files from “C:\Program Files (x86)\Zwift\data\Audio\PC” even through I have all audio turned off in my settings which is just more unneeded resources. If my music and audio settings are off, don’t just mute them, stop reading the files too.

So, I’m running Zwift on a machine with a SSD. Would fixing this have some massive improvement in load times? Probably not but I bet older hardware on non-SSD drives certainly would benefit! It’s really just an example of how cleaning up a bunch of little things can have a big overall impact. Clean this up and fix whatever changed recently to drop the frame rates Dave has mentioned and all the other little annoyances. Combined they likely result in a much better overall experience for people!

wow! great detective work!

Since I have no idea, in your opinion, how much time and effort would it take someone to clean that up?

I’ve got an excel document with all the files listed, they just need to find where they are looking for those files in their code and… well knock it off. :grinning:

It could be as simple as there is a defined list of files to load and they just need to remove those invalid entries or it could be complete spaghetti code and finding all the references could be a nightmare.

That actually is amazing. Great job. :smile:

1 Like

Bumping this as it need some recognition.

Zwift is doing a lot of work that it doesn’t need to be doing. There are crashing and framerate issues posted all over the place, this would be a good place to start.

2 Likes

Hi @Arend_teRaa

I appreciate the detailed post.

I recently reached out to the team regarding one of Dave’s posts about the poor framerates in Zwift as my own effort to try to get some feedback from a higher technical authority – still waiting to hear back.

I like the work you’ve done here as well, so I’ve highlighted your post to the team as well. I have ongoing efforts to try to get more information about these issues. Thanks for your diligence and I’ll do what I can to get some added visibility to the things you’ve mentioned.

7 Likes

Thanks @Steven_D, I appreciate the reply and for passing it along!

2 Likes

Excellent detective work. For sure cutting out needless processes will speed up things.

1 Like