Skip to content

should encode and decode both take an optional reference to a buffer #3060

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

Open
d-v-b opened this issue May 15, 2025 · 0 comments
Open

should encode and decode both take an optional reference to a buffer #3060

d-v-b opened this issue May 15, 2025 · 0 comments

Comments

@d-v-b
Copy link
Contributor

d-v-b commented May 15, 2025

in numcodecs, Codec.decode takes an out parameter, which is an optional buffer-like for storing the result of decoding. encode does not, which seems strange, because this means encode will always allocate new memory (someone correct me if I'm off base here).

in zarr-python, neither our encoding or decoding routines take an out parameter, which I think entails that every codec allocates memory every time it encodes / decodes?

so I have 2 questions:

  • should we change the zarr-python codec API to allow an out parameter for the decode functions?
  • should we do the same thing for the encode functions?
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

No branches or pull requests

1 participant