Skip to content

Commit 0e5f95a

Browse files
committed
insert timing prints
1 parent dacfe48 commit 0e5f95a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

activestorage/storage.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Active storage module."""
22
import numpy as np
33

4+
import time
5+
46
from numcodecs.compat import ensure_ndarray
57

68
def reduce_chunk(rfile,
@@ -111,8 +113,13 @@ def reduce_opens3_chunk(fh,
111113
deep in the bowels of H5py/pyfive. The reason for doing this is
112114
so we can get per chunk metrics
113115
"""
116+
t0 = time.time()
114117
fh.seek(offset)
118+
# tiny O(1e-6)
119+
# print("Seek chunk time", time.time() - t0)
115120
chunk_buffer = fh.read(size)
121+
# dominant O(2-5s) 99% of total time of _process_chunk()
122+
print("fh read chunk time", time.time() - t0)
116123
chunk = filter_pipeline(chunk_buffer, compression, filters)
117124
# make it a numpy array of bytes
118125
chunk = ensure_ndarray(chunk)

0 commit comments

Comments
 (0)