github open-toast/protokt 1.0.0-beta.10

8 hours ago

protokt 1.0.0-beta.10

Codec architecture

  • Pluggable codec backends: serialization and deserialization are now backed by swappable codec implementations. ProtobufJavaCodec, KotlinxIoCodec, and ProtoktCodec can be selected per use case. OptimalJvmCodec and OptimalKmpCodec pick the best combination automatically. (#466, #467, #476)
  • Pure Kotlin codec (ProtoktCodec): a new zero-dependency codec for byte-array serialization and deserialization, shipping with protokt-runtime. No protobuf-java or kotlinx-io dependency required. (#466, #467)
  • Module split for dependency isolation: runtime implementations split across protokt-runtime, protokt-runtime-protobuf-java, protokt-runtime-kotlinx-io, and protokt-runtime-persistent-collections so consumers only pull in the dependencies they actually use. (#476)

Performance

  • Lazily converted wrapper types: custom wrapper types (e.g. UUID, Instant) are now backed by LazyReference, deferring conversion from wire form until first access. Pass-through workloads skip conversion entirely. Wrapped elements of repeated and map fields are also lazily converted on access rather than eagerly during deserialization, and copy {} avoids converting wrapped fields unnecessarily. (#457, #483)
  • Persistent collection support: repeated and map fields can optionally use kotlinx-collections-immutable persistent data structures via PersistentCollectionFactory, enabling O(log n) structural sharing on copy {} append instead of O(n) full copies. Large-collection append is 29-99x faster. (#455)
  • Lazy strings: string fields now use LazyReference caching, deferring Bytes-to-String decoding until field access. Includes an optimized utf8Length implementation using fast-scan ASCII loops and branch-free byte counting. (#468, #483)

Platform support

  • Kotlin 2.3 and Java 25 (#453)
  • Gradle 9 (#450)

Bug fixes and maintenance

  • Get Android test fixtures working with new variant-based tool resolution (#449)
  • Fix configuration timing resolution warning (#452)
  • Fix JS gRPC tests and improve error handling (#465)
  • Run protovalidate conformance tests in CI again (#451)
  • Clean up task linking (#464)

Benchmarks

Comprehensive JMH benchmarks added across all codec implementations, protobuf-java, and Wire, covering deserialization, serialization, pass-through, mutate-and-serialize, copy/append, and string-heavy workloads. (#468, #483)

Dependency updates

Libraries:

  • Kotlin 2.2.0 -> 2.3.10
  • kotlinx-serialization-json 1.9.0 -> 1.10.0
  • binary-compatibility-validator 0.17.0 -> 0.18.1
  • grpc-java 1.73.0 -> 1.79.0
  • grpc-kotlin 1.4.3 -> 1.5.0
  • Wire 5.4.0 -> 5.5.0
  • protovalidate 0.12.0 -> 1.0.0
  • proto-google-common-protos 2.57.0 -> 2.66.1
  • JUnit Jupiter 5.13.4 -> 6.0.3
  • CEL 0.11.0 -> 0.12.0
  • kotlin-logging 7.0.13 -> 8.0.01
  • jackson-module-kotlin 2.20.0 -> 2.21.1
  • classgraph 4.8.180 -> 4.8.181
  • spotless 7.0.4 -> 8.0.0
  • gradle-maven-publish-plugin 0.34.0 -> 0.36.0
  • gradle-plugin-publish 1.3.1 -> 2.0.0
  • buildconfig 5.6.5 -> 5.6.7
  • de.undercouch.download 5.6.0 -> 5.7.0

Build tools:

  • Gradle 9.2.1 -> 9.3.1
  • actions/setup-java 4 -> 5
  • actions/checkout 4 -> 6
  • actions/download-artifact 4 -> 8
  • actions/upload-artifact 4 -> 7

Don't miss a new protokt release

NewReleases is sending notifications on new releases.