Skip to content

v0.9.0 - HTTP Performance & ARM64 Optimization

Choose a tag to compare

@srdjan srdjan released this 30 Jan 22:25

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 writeJson and HiddenClassPool methods, preventing UB in optimized builds
  • Restore array mutating methods - push, pop, shift, unshift, and splice now work correctly as builtin functions on Array.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 uses cpu * 2 (min 8) instead of cpu * 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

Full Changelog

v0.8.2...v0.9.0