Grand Theft Auto Online has some notoriously long loading times, an issue that has plagued the game since forever. No matter how many times players complained, no fix appeared on the horizon, and all sorts of theories about the cause circulated. Now, one person armed with a disassembler has done in a day, what one of the biggest game developers didn't in 7 years.
From the sheer quantity of content to the problematic peer-to-peer server structure (which is to blame for the game's constant battle with cheaters), everything has been blamed for the long loading times over the years. As it turns out, the high amount of content is partially the cause, but not in the way you'd think.
As investigated at length by GitHub user tostercx, two main culprits caused the loading time to balloon so drastically. They managed to push the ludicrous 6 minute loading time down to 1 minute and 5 seconds, which is a huge improvement - if still on the bigger end of the scale by modern standards. tostercx handily posted the custom patch on GitHub for anyone to use and an exhaustive blogpost about how it all came to be. We took the main points and translated it from programmer speak for the unwashed masses.
Essentially, every single combination of every single item you can buy in GTA Online has its own little hash entry in a comparatively massive JSON file. Coming in at an unusually heavy 10 MB for this type of file, it contains over 63,000 entries denoting all the existing ways in which a player can spend virtual money in Los Santos.
This list needs checking every time you load the game, and while 63,000 is to our primitive organic brains a large number, a modern computer should be able to crunch it in no time. The problem is that the function for checking these numbers has an exceedingly length de-duplication feature, due to which after each successful return it hops back to the very beginning of the list.
Essentially, when the game loads and successfully checks item number 23,884, it goes back to item 1, and checks each and every item again until it reaches 23,885, then back again, and so forth. Tostercx got rid of this nonsense, allowing the item check to proceed subsequently.
The other main problem was that, when loading, GTA Online was only utilizing a single CPU core instead of the many that modern devices have at their disposal. This too was an easy fix, freeing up much more computing power to check all those items you can buy.
Ultimately the custom patch cut down loading times by around 70%, and while tostercx notes that this is just a proof of concept and shouldn't be casually used, the fix is nonetheless free to download from GitHub. Since we now have definitive proof that not only is it possible to fix the loading times, but it's outright trivial, the clock is ticking for Rockstar as fans await an official fix.