Iotic-Labs/py-lz4framed

Support passing memoryview objects

ssolari opened this issue · 2 comments

Use case

We have a large pointer (memoryview) to a bytes buffer containing compressed data. Specifically we are receiving and sending compressed py-lz4framed data via zeromq zero-copy.

It would be beneficial (and possibly more performant) if we did not have to create a copy of the bytes buffer (via .tobytes()) before we passed the data to py-lz4framed.

Desired behavior

  • decompress accepts memoryview object and does not create a copy of the input data
  • compress accepts memoryview object and does not copy the input data

I apologize that my C skills aren't good enough to submit a pull-request.

I think this is already addressed by #11, but I haven't made a release with it yet.

I'll see whether I can make a release this evening for that.

v.0.9.7 should address your request hopefully. If not, please re-open this issue