-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add integration with kotlinx-io library #2707
Conversation
Integration is similar to Okio's one with functions `encodeToSink`, `decodeFromSource`, etc.
The main question is how to name module/package:
|
Personally, I like this one (most likely because I used to shorten the library name to |
} | ||
|
||
@Benchmark | ||
fun decodeMicroTwitterKotlinxIoStream(): MicroTwitterFeed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, this particular benchmark shows worse results compared to Okio version. It doesn't block integration in any way, I'll check the root cause later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a perf issue on the kotlinx-io size: an extension function to read code point values is defined only on Source
and it performs a few actions to fill the inner buffer before decoding the code point. In Okio, that's a member function with a different (and optimized) implementation for Buffer
.
kx-io should do the same: Kotlin/kotlinx-io#342.
I think this is best. This library is under Any duplicate mention of |
Have to agree with that one, but what about simply including it like kx-datetime supports kx.ser out of the box, or does this run into the issue of compileOnly not working on non-jvm platforms? |
@DRSchlaubi Yes, kotlinx-datetime actually uses |
Let's stick with |
Integration is similar to Okio's one with functions
encodeToSink
,decodeFromSource
, etc.Fixes #253