Commit 92ee8d04 authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Fix performance issue in the Python version that affected some of the tools significantly.

parent 943b3276
Pipeline #23903 passed with stages
in 5 minutes
......@@ -424,9 +424,12 @@ class ZgyInternalBulk:
Get the size of an uncompressed brick in bytes.
TODO-Performance, this should be cached on file open and
should probably be a derived attribute of self._metadata._ih.
NOTE-Performance: np.product() might be preferable to spelling out
the multiply and needing a temp. But it could be 100 times slower.
file_dtype = np.dtype(impl_enum._map_DataTypeToNumpyType(self._metadata._ih._datatype))
maxsize = np.product(self._metadata._ih._bricksize) * file_dtype.itemsize
bs = self._metadata._ih._bricksize
maxsize = bs[0] * bs[1] * bs[2] * file_dtype.itemsize
return int(maxsize)
def _getBegAndSize(self, lup, ix, maxsize):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment