'

Programmer cuts GTA V's load times by almost 70% - Rockstar needs to fix its game's poor programming

'The problems shouldn't take more than a day for a single dev to solve'

Programmer cuts GTA V's load times by almost 70% - Rockstar needs to fix its game's bad programming

Programmer cuts GTA V's load times by almost 70% - Rockstar needs to fix its game

GTA Online's loading times are long, regardless of how powerful your PC is. The game world is big, complex and constantly updated, but should that mean that loading times should remain long even though the game is almost six years old on PC? 

Last weekend, a programmed called T0ST discovered a way to shorten GTA Online's initial loading times by almost 70%, reducing the game's loading times from exactly 6 minutes to 1 minute and 50 seconds. This was using a system with an AMD FX-8350 and SSD storage. 

With GTA Online receiving continual updates and new next-generation version on PlayStation 5 and Xbox Series X, Rockstar should be looking for ways to make GTA V load faster and make the best possible use of the latest gaming hardware. This should be true for both PC and consoles. 

The Problem

The short-hand summary of the problem is that GTA V has a single-threaded CPU bottleneck, struggles to work through a 10MB JSON file and then wastes time with a slow data checking system that T0ST claims is "useless". 

With AMD's FX-8350 being a weak processor by today's standards, offering poor single-threaded performance when compared to the Intel processors of that era, T0ST issues are less prevalent on more modern systems. That said, the boosted single-threaded performance of modern CPUs will still need to waste a lot of time on these same processes, making T0ST fixes hugely valuable for Rockstar and its oncoming GTA Online development efforts. 

The first of GTA Online's problems is that it struggles to work through a 10MB JSON file that contains 63,000 items. Strangely, GTA V reads this file 63,000 times while loading GTA Online, which adds up to a lot of wasted CPU time. While each read is incredibly fast, skimming though the file 63,000 times quickly adds up to a lot of wasted CPU cycles and creates longer than necessary loading times. 

GTA Online's second issue is that the game also checks its calculations for repeated values, even though GTA Online's JSON list contains no repeated items. With the JSON list being 63,000 values long, T0ST believes that GTA Online needs to conduct 1,984,531,500 cross-checks, all of which are appear to be useless. All entries in this file are unique, removing the need for this cross-check entirely. 

To reduce GTA Online's loading times by almost 70%, T0ST created two fixes that mitigate these major issues, both of which should be considered by Rockstar games. With Grand Theft Auto 5 having over 100,000 concurrent players on Steam every day, the total time-saving benefits would be monstrous. 

If 100,000 GTA Online players could load the game 1 minute faster, the total human time savings would be 69.4 days. T0ST saved over four minutes of time when loading GTA Online with his fixes, making the time saving potential even larger for those with weaker systems. 
  

Programmer cuts GTA V's load times by almost 70% - Rockstar needs to fix its game's bad programming  

The Fix

T0ST's fix is comprised of two parts, both of which are described on his blog. The first is a bypass for the game's duplication check, removing the unnecessary check from GTA Online's loading times. This dropped GTA Online's loading times from six minutes to four minutes and 30 seconds. 

The second fix is a patch to the game's JSON parser, which caches the start and the length of GTA Online's JSON file. This change allows GTA Online to read through the file once and see the answer repeatedly without re-reading the file. Instead of reading the file 63,000 times, this fix allows the file to be read only once. This fix reduced GTA Online's loading times from 6 minutes to Two minutes and 50 seconds. 

When both of these fixes are combined, GTA Online's loading times can be reduced from six minutes to one minute and 50 seconds. The code for these fixes is available on Github, though GTA Online players shouldn't use the code as it could be seen as cheating by GTA Online's anti-cheating system. That's why Rockstar needs to implement these fixes themselves. 

Rockstar, Please Fix this

GTA Online remains incredibly popular on PC, and T0ST claims that his fixes could be implemented by a single Rockstar developer in a single day. With this in mind, Rockstar should see implementing this fix as a no-brainer. Shortened loading times will bring some PC gamers back into the world of GTA Online, and existing players will benefit from having less waiting time and more gaming time. 

If these fixes can also be brought over to the console and next-generation console versions of GTA Online, the combined human time savings of these fixes would be even more considerable. Faster loading times for the next-generation versions of GTA Online would be a big improvement for fans of the title. 

We will end this article with T0ST's plea to Rockstar Games to address these loading issues. 

If this somehow reaches Rockstar: the problems shouldn’t take more than a day for a single dev to solve. Please do something about it :<

You could either switch to a hashmap for the de-duplication or completely skip it on startup as a faster fix. For the JSON parser - just swap out the library for a more performant one. I don’t think there’s any easier way out.

ty <3

 
You can join the discussion on the programmer who reduced GTA Online's loading times by 70% on the OC3D Forums

«Prev 1 Next»

Most Recent Comments

01-03-2021, 20:10:58

ImprovizoR
I am extremely curious to see if they will actually fix it now that they have a solution handed to them on a silver platter. They are a very, very arrogant and vane company, so I will be positively surprised if they go ahead and actually do it.Quote

01-03-2021, 20:23:42

Kleptobot
Would like to see this benchmarked on different system configurations. That being said it's pretty embarrassing for the devs that coded this initially.Quote

01-03-2021, 20:25:22

Dicehunter
Rockstar are pretty well known for releasing unoptimised code, This should not surprise anyone and I highly doubt they will do anything about it, Rockstar worship money above all else, Even integrity, They will ignore this.Quote

01-03-2021, 20:28:50

tgrech
Quote:
Originally Posted by Kleptobot View Post
Would like to see this benchmarked on different system configurations. That being said it's pretty embarrassing for the devs that coded this initially.
Wouldn't quite agree, from the looks of it, seems like the implementation used for sscanf had changed from the original coders environment, would assume this is something that compiled and ran fine for PowerPC's or possibly with the x86 consoles own compilers, but the code didn't get re-profiled and updated for x86 PC port.Quote

02-03-2021, 02:31:17

ET3D
Quote:
Originally Posted by Kleptobot View Post
Would like to see this benchmarked on different system configurations. That being said it's pretty embarrassing for the devs that coded this initially.
I imagine that the original dev just wrote a function that reads a file and checks for duplicates and expected it to be run once. Plus there were, for example, just 100 entries in the file.

Then someone else probably added an easy way to get a single value over that. Then someone else had some use for going over all the values and decided to use that function, a black box.

That all went unnoticeable because there were just 100 values in the file. Even at 1000, it was hardly an issue, taking a fraction of a second. Years later, it's 63,000, and that bit of code is a major bottleneck.

The problem isn't directly with either the function itself or its use, but the combination of them. Programmers all use functions without going into their code, and people often write functions inefficiently when they don't expect them to be a bottleneck. That's something that's typically found later, when profiling for performance bottlenecks.

That, to me, is the embarrassing part, that nobody has seen fit to look into the long loading times and fix them, not that someone wrote suboptimal code to begin with.Quote
Reply
x

Register for the OC3D Newsletter

Subscribing to the OC3D newsletter will keep you up-to-date on the latest technology reviews, competitions and goings-on at Overclock3D. We won't share your email address with ANYONE, and we will only email you with updates on site news, reviews, and competitions and you can unsubscribe easily at any time.

Simply enter your name and email address into the box below and be sure to click on the links in the confirmation emails that will arrive in your e-mail shortly after to complete the registration.

If you run into any problems, just drop us a message on the forums.