I know that Android has a JSON parser baked in but I was wondering if it was worth using something that offered better performance (like Jackson - see http://jackson.codehaus.org/) ? Anybody tried that ?
The simdjson library uses commonly available SIMD instructions and microparallel algorithms to parse JSON 4x faster than RapidJSON and 25x faster than JSON for Modern C++.
Parsing JSON is much more efficient than parsing object literals in JavaScript. This is true across all major JavaScript execution engines by up to 2x for an 8MB file, as demonstrated by this parsing benchmark.
The interesting thing we can notice is that parsing JSON text is 3-5x faster than parsing equivalent XML, and twice faster than parsing equivalent spatial point. JSON_VALUE is x2 slower than PATINDEX and CHARINDEX, which is expected since these functions have much simpler parsing logic.
JavaScript Object Notation, or JSON, has gained a lot of popularity as a data interchange format in recent years. Jsoniter is a new JSON parsing library aimed at offering a more flexible and more performant JSON parsing than the other available parsers.
Well, here are a couple of links comparing Jackson JSON performance with existing JSON, SAX, and Protocol Buffers. According to the author, Jackson is faster than SAX or the built-in JSON and about on par with Protocol Buffers. That last part sounds a little suspicious, but, regardless, it certainly appears Jackson works on Android and may be worth some experimentation.
I haven't checked the JAR size, though. If it's huge, unless you were dying for extra JSON performance, it might not be worth the space hit.
Since API 11, there is a stream json parser in Android
Late answer but it might still help. I'm using Jackson for parsing JSON from Twitter as well as persisting Maps
to the database. The data mapping in Jackson is just wonderful. Being able to map JSON directly to an object is awesome and makes everything alot cleaner.
Even if you are only parsing simple replies data mapping might help you make your code cleaner (and more efficient). For me it's godsend that I don't have to write parsing logic for every type of Twitter api function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With