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