3 ms·
They wrote their own json parser which used strlen() all over the place, which is O(n), resulting in O(n^2) complexity for json parsing. The guy shimmed the fun
by tpxl 2y ago
They wrote their own json parser which used strlen() all over the place, which is O(n), resulting in O(n^2) complexity for json parsing. The guy shimmed the function to return a cached response if it was called with the same string consecutively, which it was for parsing the JSON. The JSON contained the items in the real-money store btw.
- consteval 2y agoWhy would anyone ever write their own JSON parser? There're countless libs available that are hyper-optimized.