Skip to content

Commit 7fdcd3d

Browse files
committed
tweaks
1 parent 8d03812 commit 7fdcd3d

File tree

1 file changed

+8
-49
lines changed

1 file changed

+8
-49
lines changed

cppcon2025/cppcon_2025_slides.md

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ let player: Player = serde_json::from_str(&json_str)?;
294294
- Rust does not have any built-in reflection capabilities.
295295
- Serde relies on annotation and macros.
296296

297-
<img src="image/rust_reflection.png">
297+
<img src="images/rust_reflection.jpg" width="50%">
298298

299299
---
300300

@@ -429,7 +429,7 @@ Player p = simdjson::from(json);
429429
430430
---
431431
432-
# Try It Yourself
432+
Try out this example at https://godbolt.org/z/WWGjhnjWW
433433
434434
```cpp
435435
struct Meeting {
@@ -454,7 +454,6 @@ std::string json = simdjson::to_json(Meeting{
454454
Meeting m = simdjson::from(json);
455455
```
456456

457-
Try out this example [here](https://godbolt.org/z/WWGjhnjWW)
458457

459458
---
460459

@@ -583,21 +582,6 @@ constexpr auto username_key = "\"username\":"; // Pre-computed!
583582
b.append_literal(username_key); // Just memcpy!
584583
```
585584

586-
---
587-
588-
# Consteval Performance Impact (Apple Silicon)
589-
590-
| Dataset | Baseline | No Consteval | Impact | **Speedup** |
591-
|---------|----------|--------------|--------|-------------|
592-
| Twitter | 3,211 MB/s | 1,607 MB/s | -50% | **2.00x** |
593-
| CITM | 2,360 MB/s | 978 MB/s | -59% | **2.41x** |
594-
595-
**Twitter Example (100 tweets):**
596-
- 100 tweets × 15 fields = **1,500 field names**
597-
- Without: 1,500 runtime escape operations
598-
- With: **0 runtime operations**
599-
600-
**Result: 2-2.6x faster serialization!**
601585

602586
---
603587

@@ -623,19 +607,6 @@ if (!needs_escape)
623607

624608
---
625609

626-
# SIMD Escaping Performance Impact (Apple Silicon)
627-
628-
| Dataset | Baseline | No SIMD | Impact | **Speedup** |
629-
|---------|----------|---------|--------|-------------|
630-
| Twitter | 3,211 MB/s | 2,269 MB/s | -29% | **1.42x** |
631-
| CITM | 2,360 MB/s | 2,259 MB/s | -4% | **1.04x** |
632-
633-
**Why Different Impact?**
634-
- **Twitter**: Long text fields (tweets, descriptions) → Big win
635-
- **CITM**: Mostly numbers → Small impact
636-
637-
---
638-
639610
# Optimization #3: Fast Digit Counting
640611

641612
**Traditional:**
@@ -667,16 +638,6 @@ if (UNLIKELY(buffer_full)) { // CPU knows this is rare
667638
// CPU optimizes for this path
668639
```
669640

670-
**Buffer Growth:**
671-
- Linear: 1000 allocations for 1MB
672-
- Exponential: 10 allocations for 1MB
673-
674-
| Both Optimizations | Impact | Speedup |
675-
|-------------------|--------|---------|
676-
| Twitter & CITM | ~1% | 1.01x |
677-
678-
**Small but free!**
679-
680641
---
681642

682643
# Combined Performance Impact
@@ -692,6 +653,9 @@ if (UNLIKELY(buffer_full)) { // CPU knows this is rare
692653
| **Buffer Growth** | -0.4% | +2% |
693654
| **TOTAL** | **~2.9x faster** | **~3.4x faster** |
694655

656+
657+
---
658+
695659
**From Baseline to Optimized:**
696660
- Twitter: ~1,100 MB/s → 3,211 MB/s
697661
- CITM: ~700 MB/s → 2,360 MB/s
@@ -706,13 +670,13 @@ if (UNLIKELY(buffer_full)) { // CPU knows this is rare
706670
- C++26 reflection enables unprecedented optimization
707671

708672
2. **SIMD Everywhere**
709-
- Not just for parsing anymore
710673
- String operations benefit hugely
711674

712675
3. **Avoid Hidden Costs**
713676
- Hidden allocations: `std::to_string()`
714-
- Hidden divisions: `log10(value)`
715-
- Hidden mispredictions: rare conditions
677+
678+
<!-- - Hidden divisions: `log10(value)`
679+
- Hidden mispredictions: rare conditions -->
716680

717681
4. **Every Optimization Matters**
718682
- Small gains compound into huge improvements
@@ -722,8 +686,6 @@ if (UNLIKELY(buffer_full)) { // CPU knows this is rare
722686

723687
# Thank You!
724688

725-
## Special Recognition
726-
727689
**C++ Reflection Paper Authors**
728690
- The authors of P2996 for making compile-time reflection a reality
729691

@@ -733,12 +695,9 @@ if (UNLIKELY(buffer_full)) { // CPU knows this is rare
733695

734696
**Compiler Explorer Team**
735697
- Matt Godbolt and contributors
736-
- Essential for validating our reflection approach
737-
- Enabling rapid prototyping before integration
738698

739699
**simdjson Community**
740700
- All contributors and users
741-
- Your feedback drives our innovation
742701

743702
---
744703

0 commit comments

Comments
 (0)