You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -89,15 +93,24 @@ The Rust extension is tested on:
89
93
90
94
## Performance
91
95
92
-
The Rust extension provides comparable performance to the C extension with the benefit of:
93
-
- Memory safety guarantees
94
-
- Easier maintenance and debugging
96
+
The Rust extension is currently **slower than the C extension** for both encoding and decoding:
97
+
- Simple encoding: **0.84x** (16% slower than C)
98
+
- Complex encoding: **0.21x** (5x slower than C)
99
+
- Simple decoding: **0.42x** (2.4x slower than C)
100
+
- Complex decoding: **0.29x** (3.4x slower than C)
101
+
102
+
The main bottleneck is **Python FFI overhead** - creating Python objects from Rust incurs significant performance cost.
103
+
104
+
**Benefits of Rust implementation:**
105
+
- Memory safety guarantees (prevents buffer overflows and use-after-free bugs)
106
+
- Easier maintenance and debugging with strong type system
95
107
- Cross-platform compatibility via Rust's toolchain
108
+
- 100% test compatibility with C extension
109
+
110
+
**Recommendation:** C extension remains the default and recommended choice. The Rust extension demonstrates feasibility and correctness but is not yet performance-competitive for production use.
0 commit comments