-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Use moshi implementation for json parsing #1234
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gpeal
changed the title
Okio and moshi json parsing
Use moshi implementation for json parsing
May 27, 2019
1 similar comment
swankjesse
approved these changes
May 28, 2019
Can we have this bug fix on a non AndroidX version of Lottie please (ex 2.7.x) |
@hfrsoussama I made a 3.0.3-support version but it takes a lot of manual work and I'm not sure I'm going to do it again. Maybe I'll do one more but if you want to make a branch from 3.0.7 and revert the androidx migration and make a PR, I can publish it. |
This was referenced Jul 2, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's a dependency on OKIO & 8 classes copied from Moshi. Need to figure out best path forward. Ideally we don't depend on all of Moshi but still get the gains of the new JsonReader & Options api. This should fix the random Android 8 crashes.
Performance
I ran the snapshot tests with ~1800 animations and summed up just the parsing time. The old parsing code took 13,145ms and 13,645ms on each test run (avg 13,395ms). The new code took 12,858ms each time. There aren't enough trials to deduce statistical differences but if these numbers hold, the new code parses ~5% faster.
It does reduce memory allocations during parsing which may contribute to the performance improvement.
I'm leaning on merging this to hopefully fix #667
fyi: @digitalbuddha