
Byte-first, compile-time JSON serializer generating zero-allocation codecs with bitwise O(1) trie field matching, required-field bitmask checks, dedicated readers and thread-local pools for high-throughput, low-memory endpoints.
The fastest JSON path for Kotlin Multiplatform: up to 2.7× faster than other serializers, with up to 86% less memory, and proven against the industry's conformance suite.
Keep the stack you have: kotlinx.serialization, Moshi, Gson or Jackson, with Ktor, Retrofit or Spring. Add one annotation to the DTOs that carry your traffic and Ghost takes over exactly that path. It is not a rewrite. It is an upgrade where it counts.
Quick Start: first DTO in minutes → · Try it in the browser → · Maven Central · Roadmap
Up to 2.7× faster and 86% leaner than kotlinx.serialization and Moshi on every channel we measure, and the gain grows with payload size. Adopt it one DTO at a time or across your whole model layer.
Twitter macro (631 KB) decode:
| Ghost | KSER | Moshi | |
|---|---|---|---|
| String | 1.2 GB/s · 308 KB | 0.72 GB/s · 1338 KB | 0.37 GB/s · 1709 KB |
| Bytes | 1.07 GB/s · 621 KB | 0.42 GB/s · 4297 KB | 0.28 GB/s · 4668 KB |
| Streaming | 0.53 GB/s · 1269 KB | 0.19 GB/s · 1905 KB | 0.43 GB/s · 1709 KB |
Benchmarks · HTTP Arena · Playground Speed Test
Add @GhostSerialization to a model. Keep @Serializable if you already use KotlinX: its call sites keep working.
@Serializable // keep: KotlinX call sites still work
@GhostSerialization // add: Ghost codegen for this class only
data class User(
@SerialName("user_id") // keep: Ghost uses this as the wire name
val id: Long,
val name: String,
)
Ghost.deserialize<User>(responseBytes)Drop-in for Ktor, Retrofit and Spring, with the same stack you have today. It also keeps parsing when the backend ships messy JSON (@GhostResilient, @GhostFallback, RawJson) and its errors include the JSONPath of the failure.
Also: Android · iOS · JVM · Wasm (iOS/Wasm with no registration code, via the Gradle plugin) · YAML · Proto3 JSON · Kotlin 2.2.21+ / KSP 2.3.x / Ktor 3.3.x+ → Modules
Details and how to run each check → Quality and conformance
Quick Start · Installation · Android · KMP / Ktor · iOS · Spring · YAML · Proto3 JSON · Advanced · Quality · Architecture · Contributing · Support & Versioning
The fastest JSON path for Kotlin Multiplatform: up to 2.7× faster than other serializers, with up to 86% less memory, and proven against the industry's conformance suite.
Keep the stack you have: kotlinx.serialization, Moshi, Gson or Jackson, with Ktor, Retrofit or Spring. Add one annotation to the DTOs that carry your traffic and Ghost takes over exactly that path. It is not a rewrite. It is an upgrade where it counts.
Quick Start: first DTO in minutes → · Try it in the browser → · Maven Central · Roadmap
Up to 2.7× faster and 86% leaner than kotlinx.serialization and Moshi on every channel we measure, and the gain grows with payload size. Adopt it one DTO at a time or across your whole model layer.
Twitter macro (631 KB) decode:
| Ghost | KSER | Moshi | |
|---|---|---|---|
| String | 1.2 GB/s · 308 KB | 0.72 GB/s · 1338 KB | 0.37 GB/s · 1709 KB |
| Bytes | 1.07 GB/s · 621 KB | 0.42 GB/s · 4297 KB | 0.28 GB/s · 4668 KB |
| Streaming | 0.53 GB/s · 1269 KB | 0.19 GB/s · 1905 KB | 0.43 GB/s · 1709 KB |
Benchmarks · HTTP Arena · Playground Speed Test
Add @GhostSerialization to a model. Keep @Serializable if you already use KotlinX: its call sites keep working.
@Serializable // keep: KotlinX call sites still work
@GhostSerialization // add: Ghost codegen for this class only
data class User(
@SerialName("user_id") // keep: Ghost uses this as the wire name
val id: Long,
val name: String,
)
Ghost.deserialize<User>(responseBytes)Drop-in for Ktor, Retrofit and Spring, with the same stack you have today. It also keeps parsing when the backend ships messy JSON (@GhostResilient, @GhostFallback, RawJson) and its errors include the JSONPath of the failure.
Also: Android · iOS · JVM · Wasm (iOS/Wasm with no registration code, via the Gradle plugin) · YAML · Proto3 JSON · Kotlin 2.2.21+ / KSP 2.3.x / Ktor 3.3.x+ → Modules
Details and how to run each check → Quality and conformance
Quick Start · Installation · Android · KMP / Ktor · iOS · Spring · YAML · Proto3 JSON · Advanced · Quality · Architecture · Contributing · Support & Versioning