| 1 |
import matplotlib.pyplot as plt |
| 2 |
import numpy as np |
| 3 |
|
| 4 |
|
| 5 |
labels = ['1', '2', '4', '8', '12', '14', '16', '20', '24', '28', '32'] |
| 6 |
uncompressed = [ |
| 7 |
11909.0, 21645.4, 40004.2, 56435.1, 57749.5, 58024.4, 49663.5, 55813.8, 55357.2, 56296.0, 46849.2] |
| 8 |
blosclz_cl1 = [ |
| 9 |
6016.4, 11062.0, 21284.2, 41452.4, 57542.6, 65535.6, 54084.9, 65367.7, 74655.7, 86628.0, 53853.5] |
| 10 |
lz4_cl1 = [ |
| 11 |
5194.0, 9465.5, 18262.0, 35698.7, 50247.9, 57009.0, 42268.3, 52207.0, 59755.1, 67353.5, 36658.2] |
| 12 |
lz4hc_cl1 = [ |
| 13 |
6109.7, 11114.1, 21368.7, 41932.4, 57268.5, 66780.0, 50380.2, 61220.5, 69262.0, 82380.5, 37305.5] |
| 14 |
zstd_cl1 = [ |
| 15 |
1593.8, 2955.5, 5669.4, 11244.7, 16363.2, 18377.6, 12865.2, 15830.7, 18736.9, 21474.3, 10466.3] |
| 16 |
|
| 17 |
# Use GB/s |
| 18 |
uncompressed = np.array(uncompressed) / 1024. |
| 19 |
blosclz_cl1 = np.array(blosclz_cl1) / 1024. |
| 20 |
lz4_cl1 = np.array(lz4_cl1) / 1024. |
| 21 |
lz4hc_cl1 = np.array(lz4hc_cl1) / 1024. |
| 22 |
zstd_cl1 = np.array(zstd_cl1) / 1024. |
| 23 |
|
| 24 |
x = np.arange(len(labels)) # the label locations |
| 25 |
width = 0.30 / 2 # the width of the bars |
| 26 |
|
| 27 |
fig, ax = plt.subplots() |
| 28 |
rects1 = ax.bar(x, uncompressed, width, label='Uncompressed') |
| 29 |
rects2 = ax.bar(x + width, blosclz_cl1, width, label='blosclz cl-1 (3.7x cr)') |
| 30 |
rects3 = ax.bar(x + 2 * width, lz4_cl1, width, label='lz4 cl-1 (4.5x cr)') |
| 31 |
rects4 = ax.bar(x + 3 * width, lz4hc_cl1, width, label='lz4hc cl-1 (5.0x cr)') |
| 32 |
rects5 = ax.bar(x + 4 * width, zstd_cl1, width, label='zstd cl-1 (5.9x cr)') |
| 33 |
|
| 34 |
# Add some text for labels, title and custom x-axis tick labels, etc. |
| 35 |
ax.set_ylabel('Speed (GB/s)') |
| 36 |
ax.set_xlabel('Threads') |
| 37 |
ax.set_title('Summing up precipitation data (381.5 MB, float32)') |
| 38 |
ax.set_xticks(x) |
| 39 |
ax.set_xticklabels(labels) |
| 40 |
ax.legend() |
| 41 |
|
| 42 |
#ax.bar_label(rects1, padding=3) |
| 43 |
#ax.bar_label(rects2, padding=3) |
| 44 |
#ax.bar_label(rects2, padding=3) |
| 45 |
|
| 46 |
fig.tight_layout() |
| 47 |
|
| 48 |
plt.show() |