TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Fast, auto-generated streaming JSON parsing for Android

39 pointsby mikeykover 10 years ago

6 comments

swansonover 10 years ago
Cool - if this is indeed faster than Jackson (and GSON), I would recommend writing a Retrofit converter (<a href="https://github.com/square/retrofit/tree/master/retrofit-converters" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;square&#x2F;retrofit&#x2F;tree&#x2F;master&#x2F;retrofit-conv...</a>) so developers can just drop in ig-json-parser for use with Retrofit.
评论 #8299785 未加载
jc4pover 10 years ago
This looks cool, but I&#x27;m also interested in seeing if compared to GSON not just Jackson. Is the `JsonField` annotation mandatory? In most cases my variable names are the same as the field names in the JSON, which is why I love using GSON since it auto-picks up on that.<p>It looks kind of odd in your sample code too, it&#x27;d be nice if it could auto-try those fields, but I can see why that won&#x27;t work if this is compile-time rather than at processing-time like GSON (it has no way of checking against the JSON to see if that assumption is true) -- maybe have `JsonType` take and optional parameter that enables &quot;guess types&quot; mode?
评论 #8298557 未加载
azinman2over 10 years ago
And look at how slow it still is. 40ms to parse json? I can do that around or under 1ms in iOS. When porting our app to android this was one of the biggest unexpected bottlenecks that really impacts performance. I don&#x27;t know why android doesn&#x27;t provide a native json implementation to reduce this barrier to entry.
评论 #8298138 未加载
gnewton77over 10 years ago
I&#x27;ve added an issue to chidley to generate these classes, in addition to the Java&#x2F;JAXB classes it produces now: <a href="https://github.com/gnewton/chidley/issues/4" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gnewton&#x2F;chidley&#x2F;issues&#x2F;4</a><p>(Of course only for json generation from XML)
dozyover 10 years ago
How does this compare to loading up a String of json in an org.json.JSONObject and parsing it manually?<p>For some further abstraction&#x2F;encapsulation, you can extend the JSONObject class and provide getters&#x2F;settings for particular key&#x2F;values.
评论 #8299707 未加载
nellyspageliover 10 years ago
How does this compare to GSON?
评论 #8299317 未加载
评论 #8297884 未加载