Skip to content

tako v.1.1.0

Choose a tag to compare

@dancixx dancixx released this 11 Mar 22:51
· 46 commits to main since this release
0752f44

Performance-focused release — routing, body handling, middleware, and connection setup all received significant optimizations.

Highlights

  • O(1) method dispatch via MethodMap — fixed-size array replaces HashMap for HTTP method routing
  • Zero-allocation body — new TakoBody enum avoids boxing for Full, Empty, and Incoming variants
  • Lock-free middlewareArcSwap replaces RwLock for route middleware storage
  • TCP_NODELAY on all connections — eliminates Nagle's algorithm latency
  • Custom path params deserializer — zero-copy str::parse() instead of JSON intermediary
  • LTO + codegen-units=1 in release profile for maximum binary optimization
  • 111 tests across 8 test suites · 36 examples

What's New (since v1.0.0)

Performance

Optimization Before After
Method dispatch HashMap<Method, _> lookup MethodMap fixed-size array (O(1) index)
Response body Always-boxed BoxBody TakoBody enum — Full/Empty/Incoming unboxed
Middleware reads RwLock<Vec<BoxMiddleware>> ArcSwap<Vec<BoxMiddleware>> (lock-free)
TCP connections Default (Nagle on) TCP_NODELAY enabled
Path params serde_json round-trip Custom Deserializer with str::parse()
Release binary Default LTO lto = "fat", codegen-units = 1

Routing Rework

  • Complete routing rewrite for performance
  • MethodMap stores handlers in a [Option<RouteEntry>; 9] array indexed by method
  • Dispatch is a direct array index — no hashing, no branching

Auth Handlers

  • Improved BasicAuth, BearerAuth, and JwtAuth handler ergonomics

Middleware & Routing Logic

  • Updated middleware chaining and routing dispatch
  • ArcSwap load guard pattern for zero-contention middleware reads

Examples

  • All 36 examples restructured as standalone crates with their own Cargo.toml
  • Added streams-compio and tls-compio examples
  • Fixed dependency declarations across all example crates

Fixes

  • Fixed vespera_core compatibility (pinned to v0.1.43) for OpenAPI integration
  • Fixed Compio feature dead-code warnings (BodyInner::Incoming, incoming())
  • Fixed missing dependencies in example crates (graphql-generic-ws, openapi, openapi-utoipa, streams)

Breaking Changes

None. All changes are internal optimizations. Existing v1.0.0 code compiles without changes.

Full Changelog: tako-v.1.0.0...tako-v.1.1.0