Performance dramatically slow
See original GitHub issueHi there,
I try to use the Klaxon parser together with android room.
So I have this example model:
@Entity
data class User(
@PrimaryKey
@Json(name = "user_id")
var userID: String,
@Json(name = "salutation")
var salutation: String? = null,
@Json(name = "company")
var company: String? = null,
@Json(name = "firstname")
var firstName: String? = null,
@Json(name = "lastname")
var lastName: String? = null,
@Json(name = "zip")
var zip: String? = null
)
And want to parse it from this json string:
{"firstname" : "George", "lastname" : "Clooney", "salutation" : "Herr", "user_id" : "530930", "zip" : "80335"}
And this is the code which should do all the magic:
fun getUser(): User {
val userJson = pref!!.getString(KEY_USER, "") // the preferences stores the json string from above
return Klaxon().parse<User>(userJson)!! // this method takes 8 seconds in debug mode!
}
According to the Android Studio Profiler the slow method is “findJsonPaths” called in Klaxon.kt
I do have the same performance problems at any part where I’m using the klaxon parser. Any ideas for issue?
Thanks for help.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Dramatically slow performance - Microsoft Community
My Windows 10 laptop has been dramatically slow for the last 8-10 days. It has 4GB DDR4 RAM, Core-i5 7200u processor, & HDD...
Read more >My Computer is Running Slow, What Steps Can I Do to Fix It?
Make sure your computer and processor is not overheating. Excessive heat can cause a decrease in the computer's performance because most ...
Read more >Why Your Computer Is So Slow and How To Fix It - Crucial.com
1. Identify programs that slow down your computer. 2. Check your web browser and internet connection. 3. Defragment your hard disk drive
Read more >Why your PC is so slow... and how you can speed it up
A slow computer is often caused by too many programs running simultaneously, taking up processing power and reducing the PC's performance. Some ...
Read more >8 Reasons Your Computer Is Slow (& How To Fix Them)
The Problem: Having too many games or programs installed on a computer can seriously slow down performance depending on how much processing power...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, I think it’s a genuine issue. Will take a look.
I tried it with moshi parser and got a mush better result with this code
Any idea why Klaxon is so much slower? Maybe I missed some configuration etc.