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

Avoid copying data during serialization of Record #192

Closed
ikopylov opened this issue Aug 31, 2022 · 1 comment · Fixed by #212
Closed

Avoid copying data during serialization of Record #192

ikopylov opened this issue Aug 31, 2022 · 1 comment · Fixed by #212
Assignees
Labels
enhancement New feature or request performance

Comments

@ikopylov
Copy link
Member

ikopylov commented Aug 31, 2022

Currently, the whole data copied to the final vector here: https://github.com/qoollo/pearl/blob/master/src/record.rs#L116
This becomes a problem, when data is large (~1Gb).
We can try to avoid this copy and pass data as a separate parameter to write_append here: https://github.com/qoollo/pearl/blob/master/src/blob/core.rs#L240

There is write_all_vectored function (https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all_vectored) to write 2 buffers in a single call, but it is nightly. Still not copying should provide a significant improvement for large data even with two write calls.

If the data is small (<4Kb) we can use the current approach with single buffer. For large data 2 calls is better

@ikopylov ikopylov added enhancement New feature or request performance labels Aug 31, 2022
@ikopylov
Copy link
Member Author

Related to #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants