Skip to content

Conversation

@jakirkham
Copy link
Member

@jakirkham jakirkham commented Dec 2, 2018

In Python 2/3, codecs.decode performs decoding analogous to bytes.decode except that it is not limited to bytes. In fact, it can take anything that supports the (new) buffer protocol. Thus we can avoid copying the data and instead only take an ndarray view onto it before passing the buffer to codecs.decode. Should improve performance a bit by avoiding this copy.

TODO:

  • Unit tests and/or doctests in docstrings
  • tox -e py37 passes locally
  • tox -e py27 passes locally
  • Docstrings and API docs for any new/modified user-facing classes and functions
  • Changes documented in docs/release.rst
  • tox -e docs passes locally
  • AppVeyor and Travis CI passes
  • Test coverage to 100% (Coveralls passes)

In Python 2/3, `codecs.decode` performs decoding analogous to
`bytes.decode` except that it is not limited to `bytes`. In fact, it can
take anything that supports the (new) buffer protocol. Thus we can avoid
copying the data and instead only take an `ndarray` view onto it before
passing the buffer to `codecs.decode`. Should improve performance a bit
by avoiding this copy.
@jakirkham jakirkham added this to the v0.6.2 milestone Dec 2, 2018
@jakirkham jakirkham requested a review from alimanfoo December 3, 2018 02:44
Copy link
Member

@alimanfoo alimanfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank, LGTM.

@alimanfoo alimanfoo merged commit 0c264a1 into zarr-developers:master Dec 3, 2018
@jakirkham jakirkham deleted the use_codec_decode_json branch December 3, 2018 14:30
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.

2 participants