Tuesday, February 22, 2011

[android-developers] Re: Which JSON Parser is better

I used gson and it was working fine but in some cases i got
deserialization error or wrong format in case of stroing dates in long
and then parsing them. Jackson doesn't give this error and solving my
problem. Now I am bit confused which one i should used because size of
jackson is more than gson and i do not need all functionality of the
jackson. i need only fromJson function of gson or
mapper.readValue(response, classType) of jackson.

I am also not very sure about the performance of jacson and gson.
Jackson looks bit slow.

On Dec 29 2010, 1:15 am, Bob Kerns <r...@acm.org> wrote:
> I just had a look; if I'm not mistaken, it's not really a streaming
> parser, but rather the ability to read a SEQUENCE of JSON forms from a
> stream.
>
> This avoids the ordering issue I raised earlier (JSON object fields
> are unordered), but allows you to process the sequence of JSON forms
> asynchronously in different threads (which may introduce it's own
> ordering issues, but at least it's under your control).
>
> This may be what you need; for example, you could output a series of
> JSON forms describing one high score, and loop reading them one at a
> time.
>
> However, it won't let you read some complex JSON structure, parsing it
> as it reads. Each form read will be fully-parsed in one step, and
> returned.
>
> This seems to me to be about the right compromise for JSON.
>
> The big semantic differences between JSON and XML are 1) JSON objects
> are unordered, and 2) JSON objects are not named (while their fields
> are).
>
> 1) is a headache for anything that mixes processing with reading, as
> the processing is then unordered as well.
> 2) is easily worked around by an application, but makes it harder to
> design a general API to invoke processing, and interacts badly with
> 1).
>
> But if you can recast your big JSON object as a series of smaller
> objects, each processed one at a time, a GSON does, you get most of
> the benefit and avoid most of the headaches.
>
> On Dec 27, 11:20 am, Rmac <ry...@me.com> wrote:
>
>
>
> > Check out GSON... in version 1.6 there is a new very small streaming
> > parser.- Hide quoted text -
>
> - Show quoted text -

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment