Skip to content

Conversation

@Deepscorn
Copy link

Hello! Nice library! And it is cool that you already have BenchmarkDemo implemented - simple app for comparing serialization and parsing performance of popular Gson and Jackson libs. We were curios of performance of another popular library, used in some of our projects - of google-http-client-jackson2 serializer. We've implemented test like those done with other libs in BenchmarkDemo.
Here are results and code:
https://www.dropbox.com/s/qqfbm4rr5yg7pxi/Screenshot_2015-08-04-16-34-02.png?dl=0
https://www.dropbox.com/s/85del6wnyfxgpay/Screenshot_2015-08-04-16-34-56.png?dl=0
(If interested, it's Samsung Note 2 Android 4.3)
Surprising, this library is the slowest. Maybe you have some ideas why?
Please check if our benchmark is optimized enough.

The main reason why we prefer this library is that it can handle situation when json has null value vs json key is absent. It is done via Data.isNull(). And this functionality is important for us.
Are you going to add it to LoganSquare or we can do it ourselves in next pull request?

@EricKuck
Copy link
Member

EricKuck commented Aug 6, 2015

If you're asking for support for serializing null values as null vs. just leaving them off in the json, that is already supported. You can do something like this:

@JsonObject(serializeNullObjects = true)

Thanks for adding this library to the benchmark. I'll look through the PR a bit later.

@seva-ask
Copy link

Hello!
Thx, but we need such behavior not for serializing but for parsing. Because we need to distinguish nulls from absent values got from server.
And google-api-client will give null for absent value and some object with Data.isNull(object)==true for null value

@Deepscorn
Copy link
Author

ErickCook, how to determing if value is absent and how to determine if it is null during parsing in LoganSquare?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants