https://kotlinlang.org logo
#chucker
Title
# chucker
v

Vova Buberenko

03/20/2020, 9:19 PM
Would like to note here as well that I did some benchmarking of JSON libs for particular Chucker use case and results aren’t that great for Moshi. While I also believed that Moshi should be a winner, it turned up not exactly like that. Here is more info: https://github.com/ChuckerTeam/chucker/pull/272#issuecomment-601911563 In case someone would like to run tests and won’t run into the mentioned issue there, please share results in that PR discussion.
g

gammax

03/21/2020, 6:00 PM
Thanks for doing this @Vova Buberenko . Have you seen also https://zacsweers.github.io/json-serialization-benchmarking/results/jmh/ this? I also expected to see Moshi being winner in this context. I’m fine sticking to GSON btw 👍 Although having Moshi will align us with the Square stack.
v

Vova Buberenko

03/22/2020, 11:41 PM
Thanks for the link. Yeah, results from Zac seems interesting and correspond with other results, but I don’t like that his benchmarks were run on a laptop, not on real devices. Anyway, I will take a look at his code to see it I did my formatting right.
Regarding the point of aligning with the Square stack - I highly respect these guys, but what is the advantage of being align with their stack?
h

Hitanshu Dhawan

03/23/2020, 3:17 AM
Hey guys, these are really interesting results. We should also consider memory usage as a parameter when comparing these libraries. @Vova Buberenko I did some benchmarking to see how much memory is consumed by Gson and Moshi when formatting them into pretty string. These were the results Gson
Copy code
Allocations: 2,318
Total Count: 6,612
Shallow Size: 523,648
Moshi
Copy code
Allocations: 2,645
Total Count: 6,819
Shallow Size: 372,761
In my benchmarking I found that Gson consumed 40% more memory compared to Moshi.
v

Vova Buberenko

03/23/2020, 6:23 AM
I would get the notification without tagging me directly. The problem with your benchmarking is in fact that we have no data about how you tested, on which device, no code for others to try, like I did. All these facts make your results not trustworthy. I agree that we should consider memory allocation as well, but it should be benchmarked transparently. Finally, please, stop pushing your PR that hard. Chucker has some other priorities now and you know it. In case Moshi would be a clear winner there would be no further questions. Moreover, your first attempts looked like copy-pasted code from some articles as well as the description for that PR. It makes your results even less trustworthy for me. With that said, I would appreciate you stopping pinging everyone here to covince to merge your PR ASAP.
👍 1