Back in the days, Avro4k has been created in 2019. During 5 years, a lot of work has been done greatly around avro generic records and generating schemas.
Recently, kotlinx-serialization and kotlin did big releases, improving a lot of stuff (features, performances, better APIs). The json API of kotlinx-serialization propose a great API, so we tried to replicate its simplicity.
A big focus has been done to make Avro4k more lenient to simplify devs' life and improve adoption.
I hope this major release will make Avro easier to use, even more in pure kotlin 🚀
As a side note, we may implement our own plugins to generate data classes and schemas, stay tuned !
Highlights and Breaking changes
Performances & benchmark
The following benchmark is not fully representative as it is not comparing all the features.
We will compare an easy use case: encoding and decoding a simple data class with all the primitive types, a String and a list of strings:
@Serializable
data class SimpleDataClass(
val bool: Boolean,
val byte: Byte,
val short: Short,
val int: Int,
val long: Long,
val float: Float,
val double: Double,
val string: String,
val bytes: ByteArray,
)
The benchmark has been executed on a Macbook air M2 in a mono-threaded environment.
Avro4k v2 (binary) is MUCH faster than v1 (generic records), and also now more performant than jackson and the standard apache avro (using reflection). Not tested for the moment with SpecificRecord.
Encoding Performance
Version
Encoding (ops/s)
Relative Difference (%)
... (truncated)
Commits
6e1d82a Merge pull request #240 from avro-kotlin/main-v2
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps com.github.avro-kotlin.avro4k:avro4k-core from 1.10.1 to 2.0.0.
Release notes
Sourced from com.github.avro-kotlin.avro4k:avro4k-core's releases.
... (truncated)
Commits
6e1d82a
Merge pull request #240 from avro-kotlin/main-v2f617d83
spotless + apiDumpb64158f
benchmark: add simple use case84e88f4
fix documentation6a8dd19
Merge branch 'main' into main-v2967f5ed
Merge pull request #239 from Chuckame/implicit-empty-collections999a90c
feat: Add implicitEmptyCollections configurationeda4375
Merge pull request #238 from Chuckame/feat/decimal-defaulteb37957
feat: Remove AvroDecimal defaultsb0aec20
Merge pull request #236 from Chuckame/feat/stringableDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show