Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on A Journey building a fast JSON parser and full JSONPath, Oj for Go. Parent comment
ojc_parse_str 1000000 entries in 709.300 msecs. ( 1409 iterations/msec) simdjson_parse 1000000 entries in 450.724 msecs. ( 2218 iterations/msec)
Telling simdjson we have aligned input gives us further improvement:
simdjson_parse 1000000 entries in 369.234 msecs. ( 2708 iterations/msec)
simd_parse(const char *str, int64_t iter) { simdjson::dom::parser parser; int64_t dt; + auto padded = simdjson::padded_string(std::string_view(str)); int64_t start = clock_micro(); for (int i = iter; 0 < i; i--) { - simdjson::dom::element doc = parser.parse(str, strlen(str)); + simdjson::dom::element doc = parser.parse(padded); } dt = clock_micro() - start;
There are no comments on this comment yet.
Telling simdjson we have aligned input gives us further improvement:
About 90% faster. Example changes: