v0.9.0 - HTTP Performance & ARM64 Optimization
HTTP Performance & ARM64 Optimization
This release delivers significant improvements across the HTTP pipeline, ARM64 JIT backend, and runtime correctness.
Bug Fixes
- Fix JSON serialization undefined behavior - Added bounds validation before double-slice patterns in
writeJsonandHiddenClassPoolmethods, preventing UB in optimized builds - Restore array mutating methods -
push,pop,shift,unshift, andsplicenow work correctly as builtin functions onArray.prototype - Fix substring arena allocation - Eliminated GPA mutex contention caused by substring operations escaping the arena allocator
Performance
- ARM64 register-allocated locals: 2 to 6 - Reduces stack spills for functions with more local variables on Apple Silicon and other ARM64 targets
- Optimized HTTP layer for higher throughput - Streamlined request/response pipeline for lower per-request overhead
- Native query parameter parsing - Query strings are now parsed at the native Zig layer, bypassing bytecode execution
- Numeric query parameter coercion - Numeric query values are parsed as integers at the native layer, avoiding JS type conversion
- Native _processRequest function - Benchmark endpoint uses a fully native request processing path
- Pool startup tuning -
defaultPoolSize()now usescpu * 2(min 8) instead ofcpu * 4, and prewarm count reduced from 4 to 2
Benchmarks
Updated Deno baseline comparison (Apple Silicon):
| Endpoint | zigttp RPS | Deno Baseline | Ratio |
|---|---|---|---|
| /api/health | 79,743 | 104,672 | 0.76x |
| /api/echo | 79,409 | 63,726 | 1.25x |
| /api/greet/world | 80,030 | 105,016 | 0.76x |
Tests
- Added JSON object serialization test
- Added 6 array method tests: push, pop, shift, unshift, splice
- Added Deno baseline benchmark script