Skip to content
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

Consider alternative Sink.writeString implementations on JVM #316

Open
fzhinkin opened this issue May 7, 2024 · 0 comments
Open

Consider alternative Sink.writeString implementations on JVM #316

fzhinkin opened this issue May 7, 2024 · 0 comments

Comments

@fzhinkin
Copy link
Collaborator

fzhinkin commented May 7, 2024

On JVM, instead of reading each character separately and then encoding it to UTF-8 and writing to a buffer, it might be faster to:

  • extract chars to a CharArray and then iterate over it;
  • simply use toByteArray.

For other libraries, namely kotlinx.serialization, some of these approaches performed better. While quick ad-hoc experiments didn't show any pros for kotlinx-io, it does make sense to investigate it thoroughly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant