json_benchmark
json_benchmark copied to clipboard
Basic benchmarks for miscellaneous C++ JSON parsers and generators
http://blog.thousandeyes.com/efficiency-comparison-c-json-libraries/
[pocoproject/poco](https://github.com/pocoproject/poco) provides JSON parser, may be interesting to add to the json_benchmark and compare the results with POCO's [JSON/samples/Benchmark/src/Benchmark.cpp](https://github.com/pocoproject/poco/blob/develop/JSON/samples/Benchmark/src/Benchmark.cpp)
http://www.codeproject.com/Articles/20027/JSON-Spirit-A-C-JSON-Parser-Generator-Implemented
[Requested on Twitter](https://twitter.com/cpphl/status/343366117307326465): # Qt based JSON library. @mloskot, it will be nice to add it to your benchmark http://qjson.sourceforge.net/
Suggestion from Milo Yip: Test with some pretty-formatted json, which has a lot of whitespaces. rapidjson has SSE2/4 optimization for this.
In addition to time measure, it may be interesting to measure the memory overhead. What tool or method to use, preferably portable across Linux (GCC, clang) and Windows (VS2010/2012)
Suggestion from Milo Yip: rapidjson has a "insitu" parsing mode. Which is even faster for JSON with lots of strings. E.g., `document.ParseInsitu(buffer)`. Note that content of buffer will be modified.
`strlen(s.c_str())` should make a good baseline for comparisons.