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

Zero-Copy buffer pool between java/python and native layer. #37

Open
ashione opened this issue Mar 21, 2022 · 0 comments
Open

Zero-Copy buffer pool between java/python and native layer. #37

ashione opened this issue Mar 21, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ashione
Copy link
Member

ashione commented Mar 21, 2022

We'd better avoid duplicated copy from JNI/Cython to cpp objects.

Current data transporting pipeline:

  • User writes a object in any schema, invoking collect and passing a bytes format data to Data Writer
  • Data Writer copy and move them to transporting, then send bytes data to other process.

image

There are two copy operations.

Actually, we don't need copy them between transfer and data writer, which is why we proposal zero-copy buffer pool.
How buffer pool works:

  • Get a fixed data buffer and wrap them in cython or java ByteBuffer
  • User function can serilize their data to ByteBuffer directly
  • Data Writer only capture data's pointer and transfer them in pointer
  • Release them after upstream consumed and recevied a notification from peer target.

image

@ashione ashione self-assigned this Mar 28, 2022
@ashione ashione added the enhancement New feature or request label Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant