3 ms·
GTA Online used a very slow c++ json parser for years which struggles with parsing their json file (which has grown to 10MB over the years). The load time was p
by neurostimulant 4y ago
GTA Online used a very slow c++ json parser for years which struggles with parsing their json file (which has grown to 10MB over the years). The load time was pretty bad, in some cases it can be more than 15 minutes. Improving them actually cut down startup time by 70%.
https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/ https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times...
- avg_dev 4y agoI just read this; I remember reading it a while back. It's a good article. Approachable and actually achieves its goal. Thanks for the link. > 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!) I would have loved to see someone swap out the parser for simdjson, especially without the code. That would be amazing. Maybe the 1m50s can be beaten. Just thinking about that core heating up for 6m one can see that this sort of code improvement helps reduce electricity usage, heat generated, and so on. It's just less computation. I see now that people need to parse JSON in C++ as they would any other language, and someone has to do it, and it should be done as fast and correctly as possible. It's a different issue from defining a performant wire protocol with good developer ergonomics (which to be frank I am not sure why my brain even went there to begin with; I had protobuf on the brain). Makes sense.