How serialization actually works? Is it a compiler...
# serialization
j
How serialization actually works? Is it a compiler plugin? Is it faster than kapt? Will it be faster than KSP in future?
j
It's a compiler plugin that generates visitor-like code for visiting the properties of a class. Comparing it to kapt and KSP doesn't make sense since you could not implement serialization as an annotation processor or symbol processor since it modifies classes.
j
I mean is there a performance gain when switching from kapt generated adapter for Json processing, like the one in Moshi?
j
Performance at compile-time or runtime?
j
Compile-time
j
The compiler plugin is faster, although I'm not sure build speed is a primary concern in general since you only compile once but run many times.
2