views:

1182

answers:

2

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 ?

+1  A: 

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.

CommonsWare
Yes, file size is definately in my list of possible constraints. I guess if I was chewing through lots of JSON in my app, it might be worth adding Jackson, but Ill stick with the standard JSON for now.
Eno
+2  A: 

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.

alexanderblom
Thanks for that feedback - great to have another tool in the chest if needed.
Eno