diff --git a/asdf_compression/blsc/compressor.py b/asdf_compression/blsc/compressor.py index 19886f2..61875e9 100644 --- a/asdf_compression/blsc/compressor.py +++ b/asdf_compression/blsc/compressor.py @@ -7,10 +7,15 @@ class BloscCompressor(Compressor): def compress(self, data, **kwargs): import blosc - yield blosc.compress(data, **kwargs) + # Type size, necessary for shuffle filter efficiency + # TODO: This should be the type size of the data actually stored, not just "byte" or "uint8" + typesize = data.itemsize + + yield blosc.compress(data, typesize=typesize, **kwargs) def decompress(self, data, out, **kwargs): import blosc + # TODO: call `self._api.decompress_ptr` instead to avoid copying the output out[:] = blosc.decompress(b"".join(data), **kwargs) return out.nbytes