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

Optimize Chunk #136

Open
kciesielski opened this issue May 14, 2024 · 0 comments
Open

Optimize Chunk #136

kciesielski opened this issue May 14, 2024 · 0 comments

Comments

@kciesielski
Copy link
Member

Chunk is now just a thin wrapper for an Array. It should be optimized to avoid unnecessary copying of data. Operations like concatenation,drop, take, splitAt etc. should be reimplemented. Such approach has been taken by libs like fs2 and zio, as well as Pekko's ByteString. All these libraries use their representations to represent a byte array with performance optimizations, to keep good efficiency in stream processing.
ZIO: https://github.com/zio/zio/blob/76a463192ef27c5f1ccc038cf93fe35b42ad4869/core/shared/src/main/scala/zio/Chunk.scala
fs2: https://github.com/typelevel/fs2/blob/main/core/shared/src/main/scala/fs2/Chunk.scala
Pekko: https://github.com/apache/pekko/blob/d98942dd3b021874ac324464f3fd788f9be046df/actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala

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