Skip to content

perf: parking_lot mutex for route/OpenAPI state (issue #4) - #35

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue-4-parking-lot-locks
Apr 26, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue-4-parking-lot-locks

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

Replaces std::sync::Mutex with parking_lot::Mutex for AppState and all per-method matchit routers plus the OpenAPI value lock. parking_lot uses a smaller, faster lock implementation and has no poison semantics, so the old lock_err path is removed.

Note

Issue #4 also mentions compiled route snapshots / ArcSwap after freeze(); this PR is the low-risk mutex swap only. Further work can build on the same parking_lot types.

Tests: cargo test, full pytest (30).

Closes #4

- Drop poisoning checks; lock API is infallible
- Part of issue #4 (lock contention); full snapshot/compile is future work

Closes #4

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

йцу

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 03cb48a into dev Apr 26, 2026
16 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue-4-parking-lot-locks branch April 26, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: reduce lock contention on route match (RWLock or route snapshot)

1 participant