https://github.com/quartzjer/js0n
A carbon-friendly interface is possible, but does what you ask for. Zero distributions.
http://zserge.com/jsmn.html Another approach with zero distribution.
The solutions placed above all occupy the dynamic memory allocation, so at some point they inevitably turn out to be slower, depending on the data structure, and will be dangerous to include in an environment with a limited heap, for example, an embedded system.
The vjson, rapidjson and sajson tests are here: http://chadaustin.me/2013/01/json-parser-benchmarking/ if you are interested in such a thing.
And to answer your "author" part of the question, I doubt that you could win an effective
printf("{%s:%s}",name,value)
with any library - provided that the printf / sprintf implementation itself is easy, of course.
EDIT: actually let me take this back, RapidJson only allows stack distribution through its MemoryPoolAllocator and actually does this by default for its GenericReader. I did not make a comparison, but I would expect it to be more reliable than everything listed here. It also does not have any dependencies, and it does not throw exceptions, which probably make it ultimately suitable for embedded ones. Completely based on the lib header, so it's easy to include anywhere.
kert Aug 11 '13 at 16:27 2013-08-11 16:27
source share