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

Use an {encode,decode}_bin-like interface for encoding/decoding #280

Open
pascutto opened this issue Mar 17, 2021 · 1 comment
Open

Use an {encode,decode}_bin-like interface for encoding/decoding #280

pascutto opened this issue Mar 17, 2021 · 1 comment

Comments

@pascutto
Copy link
Contributor

pascutto commented Mar 17, 2021

One remaining spot of allocations in index lives in the interface between index and repr, in the Key.encode: t -> string and Value.encode: t -> string functions of the functor argument.

These function allocate strings, but these are then blit into already existing buffers, then blit again in a file. This allocation should be avoided, by using an interface closer to repr's encode_bin.

Similar reasoning applies to decode, as this is heavily used during merges to decode all data keys.

mattiasdrp added a commit to mattiasdrp/index that referenced this issue Mar 24, 2021
@mattiasdrp
Copy link
Contributor

See #287

mattiasdrp added a commit to mattiasdrp/index that referenced this issue Apr 1, 2021
mattiasdrp added a commit to mattiasdrp/index that referenced this issue Apr 9, 2021
@pascutto pascutto changed the title Use an encode_bin like interface for encoding Use an {encode,decode}_bin-like interface for encoding/decoding May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants