• Ever wanted an RSS feed of all your favorite gaming news sites? Go check out our new Gaming Headlines feed! Read more about it here.
  • We have made minor adjustments to how the search bar works on ResetEra. You can read about the changes here.
Status
Not open for further replies.

dex3108

Member
Oct 26, 2017
22,587
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

nee.lv

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
 

hergipotter

Member
Oct 28, 2017
268
These are things that should be found and fixed during a code review during development already.
 

Kyuuji

The Favonius Fox
Member
Nov 8, 2017
32,119
OP
OP
dex3108

dex3108

Member
Oct 26, 2017
22,587
www.resetera.com

Somone figured out why GTA Online takes a buttload of time to start [Update: Rockstar planning a patch to fix the issue]

Saw this popup in my timeline: How I cut GTA Online loading times by 70% Not sure how legit this all is, but working in software development myself I’m both incredibly shocked and unfazed. What gets me is that this is still an issue after all these years? The gist of it: horrible JSON parser...

Close thread then XD
 

toad02

Banned
Oct 10, 2018
1,530
These are things that should be found and fixed during a code review during development already.

The original code was fine. It just wasn't meant to parse such a big json because they didn't think back then that GTA Online would become so big.
But, anyway, its a long time since the game became so big. It should have been reviewed again till now.
 
Status
Not open for further replies.