Skip to content

Commit c6b621d

Browse files
committed
saving
1 parent 96d3f01 commit c6b621d

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

cppcon2025/cppcon_2025_slides.md

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ CppCon 2025
2020

2121
# JSON
2222

23-
- Portable, simple
24-
- Used by ~97% of API requests. [Landscape of API Traffic 2021 - Cloudflare](https://blog.cloudflare.com/landscape-of-api-traffic/#:~:text=We%20begin%20by%20examining%20the,first%20week%20of%20February%202021)
25-
- scalar values
26-
- strings (must be escaped)
27-
- numbers (but not `NaN` or `Inf`)
28-
- composed values
29-
- objects (key/value)
30-
- arrays (list)
23+
* Portable, simple
24+
* Used by ~97% of API requests. [Landscape of API Traffic 2021 - Cloudflare](https://blog.cloudflare.com/landscape-of-api-traffic/#:~:text=We%20begin%20by%20examining%20the,first%20week%20of%20February%202021)
25+
* scalar values
26+
* strings (must be escaped)
27+
* numbers (but not `NaN` or `Inf`)
28+
* composed values
29+
* objects (key/value)
30+
* arrays (list)
3131

3232

3333
---
@@ -72,10 +72,10 @@ Source: Gwen (Chen) Shapira
7272

7373
# Performance
7474

75-
- simdjson was the first library to break the gigabyte per second barrier
75+
* simdjson was the first library to break the gigabyte per second barrier
7676
* Parsing Gigabytes of JSON per Second, VLDB Journal 28 (6), 2019
7777
* On-Demand JSON: A Better Way to Parse Documents? SPE 54 (6), 2024
78-
- JSON for Modern C++ can be $100\times$ slower!
78+
* JSON for Modern C++ (nlohmann/json) can be $100\times$ slower!
7979

8080
<img src="images/simdjson.png" width="10%" />
8181

@@ -85,9 +85,9 @@ Source: Gwen (Chen) Shapira
8585

8686
## SIMD (Single Instruction, multiple data)
8787

88-
- Allows us to process 16 (or more) bytes or more with one instruction
89-
- Supported on all modern CPUs (phone, laptop)
90-
- Data-parallel types (SIMD) (recently added to C++26)
88+
* Allows us to process 16 (or more) bytes or more with one instruction
89+
* Supported on all modern CPUs (phone, laptop)
90+
* Data-parallel types (SIMD) (recently added to C++26)
9191

9292
---
9393

@@ -103,20 +103,20 @@ Source: Gwen (Chen) Shapira
103103

104104
# SIMD support in simdjson
105105

106-
- x64: SSSE3 (128-bit), AVX-2 (256-bit), AVX-512 (512-bit)
107-
- ARM NEON
108-
- POWER (PPC64)
109-
- Loongson: LSX (128-bit) and LASX (256-bit)
110-
- RISC-V: *upcoming*
106+
* x64: SSSE3 (128-bit), AVX-2 (256-bit), AVX-512 (512-bit)
107+
* ARM NEON
108+
* POWER (PPC64)
109+
* Loongson: LSX (128-bit) and LASX (256-bit)
110+
* RISC-V: *upcoming*
111111

112112
---
113113

114114
# simdjson: Parsing design
115115

116-
- First scan identifies the structural characters, start of all strings at about 10 GB/s using SIMD instructions.
117-
- Validates Unicode (UTF-8) at 30 GB/s.
118-
- Rest of parsing relies on the generated index.
119-
- Allows fast skipping. (Only parse what we need)
116+
* First scan identifies the structural characters, start of all strings at about 10 GB/s using SIMD instructions.
117+
* Validates Unicode (UTF-8) at 30 GB/s.
118+
* Rest of parsing relies on the generated index.
119+
* Allows fast skipping. (Only parse what we need)
120120

121121
---
122122

@@ -132,15 +132,15 @@ https://openbenchmarking.org/test/pts/simdjson
132132

133133
The simdjson library is found in...
134134

135-
- Node.js
135+
- Node.js, Electron, ...
136136
- ClickHouse
137137
- Velox
138138
- Milvus
139139
- QuestDB
140140
- StarRocks
141-
- ...
142141

143-
<img src="images/nodejs.jpg" width="20%">
142+
<img src="images/nodejs.jpg" width="20%"> <img src="images/clickhouse.jpg" width="20%">
143+
144144

145145
---
146146

@@ -238,8 +238,8 @@ struct Player {
238238
239239
This manual approach has several problems:
240240
241-
1. **Maintenance Nightmare**: Add a new field? Update both functions!
242-
2. **Error-Prone**: Typos in field names, forgotten fields, type mismatches
241+
1) **Maintenance Nightmare**: Add a new field? Update both functions!
242+
2) **Error-Prone**: Typos in field names, forgotten fields, type mismatches
243243
244244
---
245245
@@ -291,8 +291,8 @@ let player: Player = serde_json::from_str(&json_str)?;
291291

292292
# Rust reflection
293293

294-
- Rust does not have any built-in reflection capabilities.
295-
- Serde relies on annotation and macros.
294+
* Rust does not have any built-in reflection capabilities.
295+
* Serde relies on annotation and macros.
296296

297297
<img src="images/rust_reflection.jpg" width="50%">
298298

@@ -303,11 +303,11 @@ let player: Player = serde_json::from_str(&json_str)?;
303303

304304
| language | runtime reflection | compile-time reflection |
305305
|:---------|:-------------------|:------------------------|
306-
| C++ 26 | 👎 ||
307-
| Go | | 👎 |
308-
| Java | | 👎 |
309-
| C# || 👎 |
310-
| Rust | 👎 | 👎 |
306+
| C++ 26 | | |
307+
| Go | | |
308+
| Java || |
309+
| C# | | |
310+
| Rust | ❌ (macros) | |
311311

312312
---
313313

@@ -359,10 +359,10 @@ Runnable example at https://godbolt.org/z/Efr7bK9jn
359359
360360
# Benefits of our implementation
361361
362-
- **No manual field mapping**
363-
- **Minimal maintenance burden**
364-
- **Handles nested and user-defined structures and containers automatically**
365-
- **You can still customize things if and when you want to**
362+
* **No manual field mapping**
363+
* **Minimal maintenance burden**
364+
* **Handles nested and user-defined structures and containers automatically**
365+
* **You can still customize things if and when you want to**
366366
367367
---
368368
@@ -463,11 +463,11 @@ We can say that serializing/parsing the basic types and custom classes/structs i
463463

464464
How do we automatically serialize ALL these different containers?
465465

466-
- `std::vector<T>`, `std::list<T>`, `std::deque<T>`
467-
- `std::map<K,V>`, `std::unordered_map<K,V>`
468-
- `std::set<T>`, `std::array<T,N>`
469-
- Custom containers from libraries
470-
- **Future containers not yet invented**
466+
* `std::vector<T>`, `std::list<T>`, `std::deque<T>`
467+
* `std::map<K,V>`, `std::unordered_map<K,V>`
468+
* `std::set<T>`, `std::array<T,N>`
469+
* Custom containers from libraries
470+
* **Future containers not yet invented**
471471

472472
---
473473

@@ -520,9 +520,9 @@ struct GameData {
520520
```
521521
522522
The magic:
523-
1. **Reflection** discovers your struct's fields
524-
2. **Concepts** match container behavior to serialization strategy
525-
3. **Result**: ALL containers work automatically - standard, custom, or future!
523+
1) **Reflection** discovers your struct's fields
524+
2) **Concepts** match container behavior to serialization strategy
525+
3) **Result**: ALL containers work automatically - standard, custom, or future!
526526
527527
**Write once, works everywhere™**
528528
@@ -723,7 +723,7 @@ We've observed a 6% slow-down when compiling simdjson with static reflection ena
723723
- Matt Godbolt and contributors
724724

725725
**simdjson Community**
726-
- All contributors and users
726+
- All contributors and users (John Keiser, Geoff Langdale, Paul Dreik...)
727727

728728
---
729729

cppcon2025/images/clickhouse.jpg

23.2 KB
Loading

0 commit comments

Comments
 (0)