Ghost Serialization 1.2.1
·
538 commits
to main
since this release
This release resolves a critical class-loading NullPointerException during cold-start JIT prewarming, introduces detailed memory profiling (KB/op) using ThreadMXBean into the Twitter macro-dataset benchmarks, and establishes automated deep-equivalence validation guaranteeing 100% data fidelity with zero-data-loss serialization roundtrips.
🚀 What's New
🛠️ Twitter Macro-Dataset Memory Profiling
- Twitter Benchmark Memory Metrics: Integrated JVM
ThreadMXBeanmemory tracking to profile real-time allocated memory per operation (KB/op) in the Twitter Macro Dataset benchmark.💡 Highlight: Demonstrates up to 6.5x memory reduction when using direct bytes.
- Special Features Twitter Tests: Included new integration tests verifying Ghost's advanced structural features (
@GhostFlatten,@GhostWrap, and@GhostIgnore) directly on Twitter-like production payloads with flawless serialization roundtrips.
🛠️ What's Changed
🛡️ Core Stability & Class-Loading Fixes
- Contextual Serializers Class-Loading NullPointerException: Resolved a critical
NPEduring class initialization of KSP-generated serializers (likeContextualModelSerializer). WhenGhost.prewarm()loaded the default registry, serializers containing external types loaded their static fields early and threw NPEs if their contextual serializers weren't already registered.Fix: Added support for the pre-registration of manual registries before calling
Ghost.prewarm().
⚙️ Twitter Benchmark Refactoring
- Twitter Benchmark Codebase Refactoring: Refactored the benchmark suite by cleanly extracting configurations, engines, data models, and the Twitter macro benchmark into BenchmarkModels.kt and TwitterBenchmark.kt, dramatically reducing the size of GhostBenchmark.kt and removing all compiler warnings.
- 100% Data Fidelity Guarantee: Added robust, automated deep-equivalence testing (
GhostTwitterReproductionTest.kt) verifying 100% exact structural parity with Kotlinx Serialization and complete zero-data-loss serialization roundtrips over the entire Twitter macro dataset.
📚 Documentation
- Best Practices: Updated
README.mdandCHANGELOG.mdwith complete guides on The Byte-First Philosophy (advocating direct byte-array parsing in network layers over UTF-16 String conversions to achieve up to 65% faster deserialization and 6.5x memory reduction). - Roadmap: Added detailed explanations of streaming decode trade-offs and outlined upcoming segment-buffering solutions.