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
{{ message }}
Repository navigation
perf: reduce lock contention on route match (RWLock or route snapshot) #4
state.lock() is taken in multiple places per request. AppState bundles routes plus five Mutex<Router<usize>> and an openapi mutex.
Direction A
After freeze(), build an Arc<CompiledRoutes> (clones of routers or a single matchit structure per method) behind ArcSwap or OnceLock and read with no write path.
Direction B
parking_lot::RwLock for openapi vs routes—measure with Criterion microbenches or wrk on a hello handler.
Acceptance criteria
No functional regression; benchmark numbers in the PR description or benches/.
Research
matchitRouter and Sync—today wrapped in Mutex. Consider matchit 0.8 migration if applicable.
Reopened after backlog review (2026-04-26): implementation is partial or the topic remains active (see .github/ISSUE_BACKLOG/bodies/04.md and PRIORITIES.md).
Context
state.lock()is taken in multiple places per request.AppStatebundles routes plus fiveMutex<Router<usize>>and anopenapimutex.Direction A
freeze(), build anArc<CompiledRoutes>(clones of routers or a single matchit structure per method) behindArcSwaporOnceLockand read with no write path.Direction B
parking_lot::RwLockforopenapivsroutes—measure with Criterion microbenches orwrkon a hello handler.Acceptance criteria
benches/.Research
RouterandSync—today wrapped inMutex. Consider matchit 0.8 migration if applicable.