@@ -434,34 +434,6 @@ Player p = simdjson::from<Player>(json);
434434
435435---
436436
437- # Real-World Benefits
438-
439- ## Before Reflection (Our Game Server example)
440- - 1000+ lines of serialization code
441- - Prone to bugs due to serialization mismatching
442- - Adding new features can imply making tedious changes to boilerplate serialization code
443-
444- ## After Reflection
445- - **0 lines** of serialization code
446- - **0 serialization bugs** (if it compiles, it works!)
447- - New features can be added much faster
448-
449- ---
450-
451- # The Bigger Picture
452-
453- This pattern extends beyond games:
454-
455- - **REST APIs**: Automatic request/response serialization
456- - **Configuration Files**: Type-safe config loading
457- - **Message Queues**: Serialize/deserialize messages
458- - **Databases**: Object-relational mapping
459- - **RPC Systems**: Automatic protocol generation
460-
461- With C++26 reflection, C++ finally catches up to languages like Rust (serde), Go (encoding/json), and C# (System.Text.Json) in terms of ease of use, but with **better performance** thanks to simdjson's SIMD optimizations.
462-
463- ---
464-
465437# Try It Yourself
466438
467439```cpp
@@ -487,32 +459,6 @@ Meeting m = simdjson::from<Meeting>(json);
487459
488460---
489461
490- # Round-Trip Any Data Structure
491-
492- ``` cpp
493- struct TodoItem {
494- std::string task;
495- bool completed;
496- std::optional< std::string > due_date;
497- };
498-
499- struct TodoList {
500- std::string owner;
501- std::vector<TodoItem > items;
502- std::map<std::string, int> tags; // tag -> count
503- };
504-
505- // Serialize complex nested structures
506- TodoList my_todos = { /* ... * / };
507- std::string json = simdjson::to_json(my_todos);
508-
509- // Deserialize back - perfect round-trip
510- TodoList restored = simdjson::from<TodoList >(json);
511- assert(my_todos == restored); // Works if you define operator==
512- ```
513-
514- ---
515-
516462# The Entire API Surface
517463
518464Just two functions. Infinite possibilities.
@@ -524,8 +470,7 @@ simdjson::from<T>(json) // → T object
524470
525471That's it.
526472
527- No macros. No code generation. No external tools.
528-
473+ No macros. No class/struct instrusion. No external tools.
529474Just simdjson leveraging C++26 reflection.
530475
531476---
@@ -641,21 +586,6 @@ _mm512_cmple_epu8_mask(word, _mm512_set1_epi8(31));
641586
642587---
643588
644- # Runtime dispatching is poor with quick functions
645-
646- - Calling a fast function like ` fast_needs_escaping ` without inlining prevents useful optimizations.
647- - Runtime dispatching implies a function call!
648-
649- ---
650-
651- # Current solution
652-
653- - No runtime dispatching (* sad face* ).
654- - All x64 processors support Pentium 4-level SIMD. Use that in a short function.
655- - * Easy* if programmer builds for specific machine (` -march=native ` ), use fancier tricks.
656-
657- ---
658-
659589# Current JSON Serialization Landscape
660590
661591<img src="images/perf_landscape.png" width="85%"/>
@@ -864,18 +794,6 @@ simdjson: 14.5 seconds ⭐
8647944 . ** Every Optimization Matters**
865795 - Small gains compound into huge improvements
866796
867- ---
868-
869- # Conclusion
870-
871- ## C++26 Reflection + simdjson =
872-
873- - ✅ ** Zero boilerplate**
874- - ✅ ** Compile-time safety**
875- - ✅ ** Blazing fast performance**
876- - ✅ ** Clean, modern API**
877-
878- Welcome to the future of C++ serialization! 🚀
879797
880798---
881799
0 commit comments