GTA Online. Infamous for its slow loading times. Having picked up the game again to finish some of the newer heists I was shocked (/s) to discover that it still loads just as slow as the day it was released 7 years ago.
It was time. Time to get to the bottom of this.
Recon
First I wanted to check if someone had already solved this problem. Most of the results I found pointed towards anecdata about how the game is so sophisticated that it needs to load so long, stories on how the p2p network architecture is rubbish (not saying that it isn't), some elaborate ways of loading into story mode and a solo session after that and a couple of mods that allowed skipping the startup R* logo video. Some more reading told me we could save a whopping 10-30 seconds with these combined!
Meanwhile on my PC…
Benchmark
Story mode load time: ~1m 10s
Online mode load time: ~6m flat
Startup menu disabled, time from R* logo until in-game (social club login time isn't counted).
Old but decent CPU: AMD FX-8350
Cheap-o SSD: KINGSTON SA400S37120G
We have to have RAM: 2x Kingston 8192 MB (DDR3-1337) 99U5471
Good-ish GPU: NVIDIA GeForce GTX 1070
I know my setup is dated but what on earth could take 6x longer to load into online mode? I couldn't measure any difference using the story-to-online loading technique as others have found before me. Even if it did work the results would be down in the noise.
Armed with such powerful tools as the Task Manager I began to investigate what resources could be the bottleneck.
After taking a minute to load the common resources used for both story and online modes (which is near on par with high-end PCs) GTA decides to max out a single core on my machine for four minutes and do nothing else.
Disk usage? None! Network usage? There's a bit, but it drops basically to zero after a few seconds (apart from loading the rotating info banners). GPU usage? Zero. Memory usage? Completely flat…What, is it mining crypto or something? I smell code. Really bad code.
And from this point on it is basically going through code and various legal and probably illegal things to find what part of the code is the issue. And result is this
Results
Well, did it work then?
Original online mode load time: ~6m flat
Time with only duplication check patch: 4m 30s
Time with only JSON parser patch: 2m 50s
Time with both issues patched: 1m 50s
(6*60 - (1*60+50)) / (6*60) = 69.4% load time improvement (nice!)
Hell yes, it did! :))
Most likely, this won't solve everyone's load times - there might be other bottlenecks on different systems, but it's such a gaping hole that I have no idea how R* has missed it all these years.
tl;dr
There's a single thread CPU bottleneck while starting up GTA Online
It turns out GTA struggles to parse a 10MB JSON file
The JSON parser itself is poorly built / naive and
After parsing there's a slow item de-duplication routine
How I cut GTA Online loading times by 70%
GTA Online. Infamous for its slow loading times. Having picked up the game again to finish some of the newer heists I was shocked (/s) to discover that it still loads just as slow as the day it was re
nee.lv