A benchmark measures performance under a defined workload and set of conditions. Test the code and data patterns that matter to your use case: implementations can perform differently, so a published result may not predict your own. section 4.3.2 section 6.2.1
Make comparisons interpretable by matching the benchmark to the work being measured:
- Use varied, representative inputs. Zero-filled, tiled, and random arrays produce very different compression behavior. section 6.2.1
- Measure relevant costs separately. Compression comparisons include both elapsed time and disk space; disk-write tests flush operating-system buffers before timing. section 6.2.1
Comparing array writes
For zero-filled and tiled arrays, Blosc writes took about 0.53 seconds versus 7.49 seconds for NumPy; for random data, NumPy was slightly faster. Compressed tiled and zero arrays also occupied far less disk space, while random data did not shrink. section 6.2.1
os.system("sync")
%time write_numpy(zero_arr, "zero")
%time write_blosc(zero_arr, "zero")
%time write_numpy(rep_tile_arr, "rep_tile")
%time write_blosc(rep_tile_arr, "rep_tile")
%time write_numpy(random_arr, "random")
%time write_blosc(random_arr, "random")
View the timing calls used to compare NumPy and Blosc writes across the three array types. section 6.2.1






















