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 serialization #305

Merged
merged 8 commits into from
May 14, 2024
Merged

Zero copy serialization #305

merged 8 commits into from
May 14, 2024

Conversation

LGFae
Copy link
Owner

@LGFae LGFae commented May 11, 2024

By mmaping the relevant bytes at the correct offsets, we don't need to copy any str or Boxed<[u8]>.

Furthermore, we can serialize directly onto the memory mapped file, thus not needing to copy onto an intermediate buffer first.

LGFae added 8 commits May 14, 2024 11:23
This avoid an extra copy, where we were first putting everything in a
large vector, then serializing those into bytes, THEN mapping that to
the file.

Now, the ImageRequestBuilder will by itself already write the image
requests to the mmapped file.

The code has gotten unruly, we should do some refactoring later.
Things were getting way too chaotic. Now we have multiple smaller files,
each roughly concerned with a different problem.
@LGFae LGFae merged commit e323739 into main May 14, 2024
10 checks passed
@LGFae LGFae deleted the zero-copy-serialization branch May 14, 2024 14:53
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

Successfully merging this pull request may close these issues.

1 participant