Skip to content

Commit 70fec69

Browse files
committed
saving.
1 parent 526f093 commit 70fec69

File tree

7 files changed

+16
-39
lines changed

7 files changed

+16
-39
lines changed

cppcon2025/cppcon_2025_slides.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ We've observed a 6% slow-down when compiling simdjson with static reflection ena
741741

742742
4) **SIMD**: String operations benefit
743743

744+
5) **Many optimization helps**
744745

745746
---
746747

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
| Library/Method | Throughput | Time/iter | Notes |
3+
|----------------|------------|-----------|-------|
4+
| **simdjson (manual)** | 4.36 GB/s | 138.04 μs | Hand-written parsing code |
5+
| **simdjson::from()** | 4.17 GB/s | 144.45 μs | High-level API, uses C++26 reflection |
6+
| **simdjson (reflection)** | 4.09 GB/s | 147.19 μs | C++26 static reflection |
7+
| **yyjson** | 2.23 GB/s | 269.71 μs | C library |
8+
| **Serde (Rust)** | 1.72 GB/s | 349.75 μs | Via FFI |
9+
| **RapidJSON** | 658 MB/s | 915.14 μs | Full extraction |
10+
| **nlohmann/json** | 172 MB/s | 3501.02 μs | Full extraction |

cppcon2025/data/parsingtwitterapplem3max.txt renamed to cppcon2025/data/serializationtwitterapplem3max.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ bench_yyjson : 1909.87 MB/s 0
2727
# Reading file /Users/random_person/Desktop/simdjson/buildreflect/jsonexamples/twitter.json
2828
# Note: Rust/Serde may include additional fields not in C++ structure.
2929
# output volume: 93311 bytes
30-
bench_rust : 417.89 MB/s 0.00 Ms/s
30+
bench_rust : 1710 MB/s
3131

3232
=== Reflect-cpp ===
3333
# Reading file /Users/random_person/Desktop/simdjson/buildreflect/jsonexamples/twitter.json
3434
# output volume: 93311 bytes
35-
bench_reflect_cpp : 1517.55 MB/s 0.02 Ms/s
35+
bench_reflect_cpp : 1517.55 MB/s 0.02 Ms/s

cppcon2025/images/generate_perf_charts.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Chart 1: Current landscape (without simdjson)
55
libraries_landscape = ["nlohmann::json", "RapidJSON", "Serde (Rust)", "yyjson"]
6-
speeds_landscape = [242, 497, 1343, 2074]
6+
speeds_landscape = [174, 529, 1710, 1909]
77
colors_landscape = ['#8B8680', '#6495ED', '#FF6F61', '#2ECC71']
88

99
plt.figure(figsize=(10, 6))
@@ -35,7 +35,7 @@
3535

3636
# Chart 2: With simdjson reveal
3737
libraries_with = ["nlohmann::json", "RapidJSON", "Serde (Rust)", "yyjson", "simdjson"]
38-
speeds_with = [242, 497, 1343, 2074, 3435]
38+
speeds_with = [174, 529, 1710, 1909, 3598]
3939
colors_with = ['#8B8680', '#6495ED', '#FF6F61', '#2ECC71', '#FFD700']
4040

4141
plt.figure(figsize=(10, 6))
@@ -69,10 +69,9 @@
6969
plt.savefig('perf_with_simdjson.png', dpi=300, bbox_inches='tight')
7070
plt.close()
7171

72-
7372
# Chart 2b: Parsing only (same style)
7473
plt.figure(figsize=(10, 6))
75-
bars = plt.bar(libraries_with, [172, 658, 1720, 2230, 4090], color=colors_with, edgecolor='black')
74+
bars = plt.bar(libraries_with, [172, 658, 1720, 2637, 4170], color=colors_with, edgecolor='black')
7675
ax = plt.gca()
7776
ax.spines['top'].set_visible(False)
7877
ax.spines['right'].set_visible(False)
@@ -99,40 +98,7 @@
9998

10099

101100

102-
# Chart 3: Final comparison (sorted)
103-
libraries_sorted = ["simdjson", "yyjson", "Serde (Rust)", "RapidJSON", "nlohmann::json"]
104-
speeds_sorted = [3435, 2074, 1343, 497, 242]
105-
colors_sorted = ['#FFD700', '#2ECC71', '#FF6F61', '#6495ED', '#8B8680']
106-
107-
plt.figure(figsize=(10, 6))
108-
bars = plt.bar(libraries_sorted, speeds_sorted, color=colors_sorted, edgecolor='black')
109101

110-
ax = plt.gca()
111-
ax.spines['top'].set_visible(False)
112-
ax.spines['right'].set_visible(False)
113102

114-
lang_labels = ["C++", "C", "Rust", "C++", "C++"]
115-
for i, bar in enumerate(bars):
116-
yval = bar.get_height()
117-
label = f'{yval} MB/s ' if libraries_sorted[i] == 'simdjson' else f'{yval} MB/s'
118-
plt.text(bar.get_x() + bar.get_width()/2, yval + 50, label,
119-
ha='center', va='bottom', fontsize=12)
120-
plt.text(bar.get_x() + bar.get_width()/2, yval + 150, lang_labels[i],
121-
ha='center', va='bottom', fontsize=12, color='black', fontweight='bold', style='italic')
122-
123-
# Highlight simdjson
124-
bars[0].set_linewidth(3)
125-
bars[0].set_edgecolor('#FF0000')
126-
127-
plt.ylabel('Throughput (MB/s)', fontsize=14)
128-
plt.ylim(0, 4000)
129-
plt.title('Twitter Dataset (631KB) - Serialization Performance', fontsize=16)
130-
plt.text(0.01, 0.99, 'Apple Silicon (M3 MAX)', transform=ax.transAxes,
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')
134-
plt.tight_layout()
135-
plt.savefig('perf_comparison.png', dpi=300, bbox_inches='tight')
136-
plt.close()
137103

138104
print("Performance charts generated successfully!")
451 Bytes
Loading
6.97 KB
Loading
5.5 KB
Loading

0 commit comments

Comments
 (0)