summaryrefslogtreecommitdiff
path: root/AK/JsonParser.h
AgeCommit message (Collapse)Author
2019-08-04JsonParser: Fold extract_while() into parse_number()Andreas Kling
It wasn't unsed anywhere else anyway, and this is actually ~1% faster on the load_4chan_catalog benchmark.
2019-08-04JsonParser: Cache the last seen string starting with each possible charAndreas Kling
Keep a 256-entry string cache during parse to avoid creating some new strings when possible. This cache is far from perfect but very cheap. Since none of the strings are transient, this only costs us a couple of pointers and a bit of ref-count manipulation. The cache hit rate on 4chan_catalog.json is ~33% and the speedup on the load_4chan_catalog benchmark is ~7%.
2019-08-04JsonParser: Some minor optimizationsAndreas Kling
- Return more specific types from parse_array() and parse_object(). - Don't create a throwaway String in extract_while(). - Use a StringView in parse_number() to avoid a throwaway String.
2019-06-24AK: Let's put the JSON parsing in a separate class.Andreas Kling