GTA online took ages to load, like 10+ minutes on some machines. One guy got really annoyed and investigated. It turned out to be loading a single 10MB JSON file in an incredibly inefficient manner. The JSON file contains about 60,000 items and they need to extract each item from it, but every time they look for the next item they start from the beginning of the file again, despite already knowing where they found the previous item!
All the entries in the JSON list are unique, but the code also checks for any duplicate entries, of course it’s also done in the least efficient way possible requiring 1,984,531,500 comparisons for something that has no effect.
Not only did this one person find these problems but he also implemented a fix that reduced load times by 70% as a result, shaving off more than 7 minutes of load times for some machines. The fact that Rockstar didn’t notice this is frankly shocking and speaks to the fact that they really just don’t care.
GTA online took ages to load, like 10+ minutes on some machines. One guy got really annoyed and investigated. It turned out to be loading a single 10MB JSON file in an incredibly inefficient manner. The JSON file contains about 60,000 items and they need to extract each item from it, but every time they look for the next item they start from the beginning of the file again, despite already knowing where they found the previous item! All the entries in the JSON list are unique, but the code also checks for any duplicate entries, of course it’s also done in the least efficient way possible requiring 1,984,531,500 comparisons for something that has no effect. Not only did this one person find these problems but he also implemented a fix that reduced load times by 70% as a result, shaving off more than 7 minutes of load times for some machines. The fact that Rockstar didn’t notice this is frankly shocking and speaks to the fact that they really just don’t care.
https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/