tako v.1.1.0
Performance-focused release — routing, body handling, middleware, and connection setup all received significant optimizations.
Highlights
- O(1) method dispatch via
MethodMap— fixed-size array replacesHashMapfor HTTP method routing - Zero-allocation body — new
TakoBodyenum avoids boxing forFull,Empty, andIncomingvariants - Lock-free middleware —
ArcSwapreplacesRwLockfor 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
MethodMapstores 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, andJwtAuthhandler ergonomics
Middleware & Routing Logic
- Updated middleware chaining and routing dispatch
ArcSwapload guard pattern for zero-contention middleware reads
Examples
- All 36 examples restructured as standalone crates with their own
Cargo.toml - Added
streams-compioandtls-compioexamples - Fixed dependency declarations across all example crates
Fixes
- Fixed
vespera_corecompatibility (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