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
*Benchmark measures complete settings initialization with complex configuration (app settings, database, redis, feature flags) including .env file parsing and type validation. Run `./benchmark/run_benchmark.sh` to reproduce.*
147
+
| Library | Time per load | Relative Performance |
148
+
|---------|---------------|---------------------|
149
+
| msgspec-ext | 0.023ms | Baseline ⚡ |
150
+
| pydantic-settings | 1.350ms | 58.7x slower |
151
+
152
+
**Cold Start vs Warm Performance:**
153
+
- Cold start: 1.489ms (1.3x faster than pydantic-settings)
154
+
- Warm cached: 0.011ms (117.5x faster than pydantic-settings)
155
+
- Internal speedup: 129.6x faster when cached
156
+
157
+
msgspec-ext is **ultra-optimized** with advanced caching strategies:
158
+
- Field name to env name mapping cache
159
+
- Absolute path cache for file operations
160
+
- Type introspection cache for complex types
161
+
- Atomic encoder/decoder cache pairs
162
+
- Fast paths for primitive types (str, bool, int, float)
163
+
- Local variable caching in hot loops
164
+
165
+
*Benchmark measures complete settings initialization with complex configuration (app settings, database, redis, feature flags) including .env file parsing and type validation. Run `./benchmark/benchmark.py` to reproduce.*
163
166
164
167
## Why msgspec-ext?
165
168
166
-
-**Performance** - 89x faster than pydantic-settings
169
+
-**Performance** - 117.5x faster than pydantic-settings when cached, 1.3x faster on cold start
0 commit comments