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

Determine feasibility of avoiding copies while creating PutChunks #397

Open
vgkholla opened this issue Jul 13, 2016 · 0 comments
Open

Determine feasibility of avoiding copies while creating PutChunks #397

vgkholla opened this issue Jul 13, 2016 · 0 comments
Assignees

Comments

@vgkholla
Copy link
Contributor

Creating this issue to explore the possibility of not creating a copy of the data while creating chunks that need to be put (at the NonBlockingRouter).

Currently, creating put chunks involves copying data from the buffer provided from the ReadableStreamChannel (the chunks themselves are implementations of AsyncWritableChannel). Since ReadableStreamChannel implementations are not allowed to overwrite/reuse buffers until they receive callbacks from the AsyncWritableChannel, it might be possible to avoid the copy.

The main problem will be the fact that the chunk size enforced at the NonBlockingRouter will not be equal to the sizes of the individual buffers received. This means that
P.1) Composite byte buffers will have to be created.
P.2) The modules downstream will have to understand these composite byte buffers (i.e. network modules).
P.3) There will be many boundary conditions (for e.g. a source buffer's data might be across chunk boundaries).

It will be useful to evaluate if this is possible (without introducing too much complexity) since avoiding the copy might translate into better performance.

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

No branches or pull requests

2 participants