Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not so Fast with the Nexus 6P #159

Open
LuigiPapino opened this issue Apr 30, 2016 · 11 comments
Open

Not so Fast with the Nexus 6P #159

LuigiPapino opened this issue Apr 30, 2016 · 11 comments

Comments

@LuigiPapino
Copy link

LuigiPapino commented Apr 30, 2016

I did some tests and found that on recent phones, like the Nexus 6P, LoganSquare doesn't result so fast in comparison with GSON and specially Jackson.
Anyone else with this problem, or a device related issue?

Nexus 6P API 23

screenshot_20160430-221545
screenshot_20160430-221604

Samsung S5 API 21

screenshot_2016-04-30-22-43-12
screenshot_2016-04-30-22-43-03

@alfdev
Copy link

alfdev commented May 1, 2016

I confirm what LuigiPapino says, the issue seems present since android Lollipop.

@Zhuinden
Copy link

Zhuinden commented May 4, 2016

I think the issue isn't that LoganSquare is slow, but that Android has maybe increased reflection performance. I can't know for sure, though!

@trevjonez
Copy link
Contributor

Also keep in mind the implementation of String and the underlying char[] was optimized in api 23 which could further reduce differences.

@chenfei0928
Copy link

chenfei0928 commented Jun 28, 2016

Why JSON processing use Jsckson.
Since it has been for the Android platform, JsonWriter has better performance?

@Zhuinden
Copy link

@chenfei0928 because it uses jackson core streaming api

@Macarse
Copy link

Macarse commented Jul 19, 2016

it would be also nice to test with Jackson-jr (https://github.com/FasterXML/jackson-jr)

@cowtowncoder
Copy link

I also suggest that it is not slowing down of this library as much as likely speed up of some aspects of Android's SDK. Reflection improvements, as mentioned, would be a huge deal -- Android reflection performance has been really, REALLY bad, and lead to unfortunately high startup times for Jackson (even where Jackson's newer versions try to reduce amount of work done upfront).

@Macarse
Copy link

Macarse commented Jul 19, 2016

AndroidEngTeam replied this about reflection in M and N:

We’ve optimized code paths and code generation related to reflection through M and N. There have been numerous improvements (all of which you can find in AOSP). For example, in N we’ve hand-optimized some of the annotation code.

https://www.reddit.com/r/androiddev/comments/4tm8i6/were_on_the_android_engineering_team_and_built/d5in5rb

@cowtowncoder
Copy link

Very cool. This should help a lot with libraries that rely on reflection. I wonder if there could also be similar improvements to annotation access, which is something that has been slow as well, and possibly due to similar reasons (access to annotation information uses reflection(-like) functionality heavily).

@EricKuck
Copy link
Member

Compile-time annotations don't use any reflection and can't really be optimized. They just end up as code in the app.

@cowtowncoder
Copy link

@EricKuck I understand, but I was referring to runtime annotations (which LS probably doesn't use, but others like Jackson and GSON do).

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

No branches or pull requests

8 participants