summaryrefslogtreecommitdiff
path: root/AK/JsonParser.cpp
AgeCommit message (Collapse)Author
2019-08-14JsonParser: "" is an empty string, not a null valueAndreas Kling
2019-08-07JsonParser: Scan ahead to find the first special char in quoted stringsAndreas Kling
This allows us to take advantage of the now-optimized (to do memmove()) Vector::append(const T*, int count) for collecting these strings. This is a ~15% speedup on the load_4chan_catalog benchmark.
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: Oops, fix build.Andreas Kling
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-08-04JsonParser: Use Vector<char, 1024> instead of StringBuilder in parsingAndreas Kling
This is a 10-12% speedup on the 4chan thread catalog JSON.
2019-08-04JsonParser: When encountering \uXXXX, just emit a "?" for now.Andreas Kling
2019-08-01JsonParser: Merge the parsing of '\n' and '\r' in quoted stringsAndreas Kling
2019-07-08AK: Add JsonObject::set(key, &&value) overload.Andreas Kling
This dodges a whole bunch of value copying in JsonParser.
2019-06-29Kernel: Change the format of /proc/all to JSON.Andreas Kling
Update ProcessManager, top and WSCPUMonitor to handle the new format. Since the kernel is not allowed to use floating-point math, we now compile the JSON classes in AK without JsonValue::Type::Double support. To accomodate large unsigned ints, I added a JsonValue::Type::UnsignedInt.
2019-06-25JsonParser: Support basic escaped string characters.Andreas Kling
I didn't implement \uXXXX-style escape in this patch. That's a FIXME.
2019-06-24AK: Let's put the JSON parsing in a separate class.Andreas Kling