Serialization in JVM, Android and Kotlin Multiplatform: Complete Analysis of Serializable, Externalizable, Parcelable and kotlinx.serialization
An architectural study of different approaches to transforming objects into bytes. We analyze four fundamental approaches based on benchmarks: reflective automation of Serializable, manual control of Externalizable, platform optimization of Parcelable, and universal code generation of kotlinx.serialization. We explore not only how these mechanisms work, but why they were created this way, what trade-offs are embedded in their architecture, and how they perform in different environments, from server JVM to mobile Android to cross-platform Kotlin.
Osman Suleimanov 45 min read