I have a json file, it's about 1 MB. I'm trying to parse this JSON with Klaxon library but it takes about 30 seconds. I don't want to use SQLite. What can i do?
Asked
Active
Viewed 226 times
0
-
Maybe try GSON? or Jackson? – Peterdk Feb 02 '19 at 19:04
-
@Peterdk How effective? – Webmaster WM Feb 02 '19 at 19:05
2 Answers
1
1 MB for a JSON file is pretty massive.
What can i do?
You can:
- Make your JSON smaller.
- Try a different parser library and see if it helps.
- Accept the slow parse time (add a spinner or something).

dominicoder
- 9,338
- 1
- 26
- 32
-
Yeah, this isn't very big. I think my JSON parser is bad. I'll try another JSON parser. – Webmaster WM Feb 03 '19 at 08:41
0
I solved the problem. I used this answer: https://stackoverflow.com/a/50468095/10381014 Now, my json parse process takes only 1 second.

Webmaster WM
- 3
- 1