|
26 | 26 | plt.title('Current JSON Serialization Landscape', fontsize=16) |
27 | 27 | plt.text(0.01, 0.99, 'Apple Silicon (M3 MAX)', transform=ax.transAxes, |
28 | 28 | fontsize=14, ha='left', va='top', style='italic', color='black') |
| 29 | + |
| 30 | +plt.text(0.01, 0.89, 'twitter.json', transform=ax.transAxes, |
| 31 | + fontsize=14, ha='left', va='top', style='italic', color='black') |
29 | 32 | plt.tight_layout() |
30 | 33 | plt.savefig('perf_landscape.png', dpi=300, bbox_inches='tight') |
31 | 34 | plt.close() |
|
60 | 63 | plt.title('JSON Serialization Performance', fontsize=16) |
61 | 64 | plt.text(0.01, 0.99, 'Apple Silicon (M3 MAX)', transform=ax.transAxes, |
62 | 65 | fontsize=14, ha='left', va='top', style='italic', color='black') |
| 66 | +plt.text(0.01, 0.89, 'twitter.json', transform=ax.transAxes, |
| 67 | + fontsize=14, ha='left', va='top', style='italic', color='black') |
63 | 68 | plt.tight_layout() |
64 | 69 | plt.savefig('perf_with_simdjson.png', dpi=300, bbox_inches='tight') |
65 | 70 | plt.close() |
66 | 71 |
|
| 72 | + |
| 73 | +# Chart 2b: Parsing only (même style) |
| 74 | +plt.figure(figsize=(10, 6)) |
| 75 | +bars = plt.bar(libraries_with, [172, 658, 1720, 2230, 4090], color=colors_with, edgecolor='black') |
| 76 | +ax = plt.gca() |
| 77 | +ax.spines['top'].set_visible(False) |
| 78 | +ax.spines['right'].set_visible(False) |
| 79 | +lang_labels = ["C++", "C++", "Rust", "C", "C++"] |
| 80 | +for i, bar in enumerate(bars): |
| 81 | + yval = bar.get_height() |
| 82 | + label = f'{yval} MB/s ' if libraries_with[i] == 'simdjson' else f'{yval} MB/s' |
| 83 | + plt.text(bar.get_x() + bar.get_width()/2, yval + 50, label, |
| 84 | + ha='center', va='bottom', fontsize=12) |
| 85 | + plt.text(bar.get_x() + bar.get_width()/2, yval + 180, lang_labels[i], |
| 86 | + ha='center', va='bottom', fontsize=12, color='black', fontweight='bold', style='italic') |
| 87 | +bars[-1].set_linewidth(3) |
| 88 | +bars[-1].set_edgecolor('#FF0000') |
| 89 | +plt.ylabel('Throughput (MB/s)', fontsize=14) |
| 90 | +plt.ylim(0, 4500) |
| 91 | +plt.title('JSON Parsing Performance', fontsize=16) |
| 92 | +plt.text(0.01, 0.99, 'Apple Silicon (M3 MAX)', transform=ax.transAxes, |
| 93 | + fontsize=14, ha='left', va='top', style='italic', color='black') |
| 94 | +plt.text(0.01, 0.89, 'twitter.json', transform=ax.transAxes, |
| 95 | + fontsize=14, ha='left', va='top', style='italic', color='black') |
| 96 | +plt.tight_layout() |
| 97 | +plt.savefig('perf_with_simdjson_parsing.png', dpi=300, bbox_inches='tight') |
| 98 | +plt.close() |
| 99 | + |
| 100 | + |
| 101 | + |
67 | 102 | # Chart 3: Final comparison (sorted) |
68 | 103 | libraries_sorted = ["simdjson", "yyjson", "Serde (Rust)", "RapidJSON", "nlohmann::json"] |
69 | 104 | speeds_sorted = [3435, 2074, 1343, 497, 242] |
|
94 | 129 | plt.title('Twitter Dataset (631KB) - Serialization Performance', fontsize=16) |
95 | 130 | plt.text(0.01, 0.99, 'Apple Silicon (M3 MAX)', transform=ax.transAxes, |
96 | 131 | fontsize=14, ha='left', va='top', style='italic', color='black') |
| 132 | +plt.text(0.01, 0.89, 'twitter.json', transform=ax.transAxes, |
| 133 | + fontsize=14, ha='left', va='top', style='italic', color='black') |
97 | 134 | plt.tight_layout() |
98 | 135 | plt.savefig('perf_comparison.png', dpi=300, bbox_inches='tight') |
99 | 136 | plt.close() |
|
0 commit comments