facebookarchive/Keyframes

Documentation: Explain about decoding JSON in the background

Open

#103 ouverte le 12 janv. 2017

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)JavaScript (304 forks)batch import
do-not-reaphelp wanted

Métriques du dépôt

Stars
 (5 337 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Hey guys,

Using the Android library here. When loading large json files, I'm getting around a 2-3 second UI hang. This was obviously undesired and I narrowed down the issue to being in the deserialization of the asset from the InputStream. The way I got around the issue was by using an Rx chain and pushing the deserialization off of the UI thread while providing a Looper from a HandlerThread to the Scheduler. I'm sure this can be achieved in a similar fashion with AsyncTask if needed.

In general, the file still takes around 2 seconds to load while on a background thread. Our animation files are around 30k - 50k lines long.

Guide contributeur