Lionel Briand
08/14/2024, 10:08 AM@Serializable
data class Example(val foo: String, val bar: Int)
fun main() {
val example = Example("Hello World !", 42)
val encode = Cbor.encodeToHexString(example)
assert(encode == "a263666f6f6d48656c6c6f20576f726c64202163626172182a")
val decode = Cbor.decodeFromHexString<Example>(encode)
assert(example == decode)
}
Oleg Yukhnevich
08/14/2024, 10:20 AMkotlinx-serialization-cbor
which was updates with tags and other things not so long time ago? (not released yet, https://github.com/Kotlin/kotlinx.serialization/pull/2412)Lionel Briand
08/14/2024, 10:55 AMBernd Prünster
08/14/2024, 4:53 PMLionel Briand
08/16/2024, 6:08 AMbenchmark
and it seems the one in 1.7.2-RC is faster.Bernd Prünster
08/16/2024, 6:29 AMdev
branch?Lionel Briand
08/16/2024, 6:52 AMdev
branch is faster. I don't know why, I've just tested a basic benchmark case. Since you were asking, I thought of informing you. If you want I'll also inform you if i find further optimisations.Bernd Prünster
08/16/2024, 7:28 AM