Skip to content

perf(routing): auto-enable compiled snapshot on request path - #85

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
issue-75-routing-compiled-snapshot
Apr 27, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
issue-75-routing-compiled-snapshot

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • auto-build compiled route snapshot on first HTTP request to keep matching lock-free without mandatory explicit freeze
  • invalidate stale compiled snapshot when new routes are registered before freeze, then lazily rebuild on next request
  • add regression tests and docs for auto-compile + route-registration lifecycle behavior

Test plan

  • uv run maturin develop --uv
  • uv run pytest tests/test_routing_autocompile.py tests/test_api_router.py tests/test_405.py

Closes #75

Build compiled route tables lazily on first HTTP request and invalidate stale snapshots when routes are added before freeze, keeping hot-path matching lock-free without forcing strict startup ordering.
Add regression tests that verify routes added after first request still resolve and 405/Allow behavior remains correct with lazy compiled snapshots.
Document first-request auto-compilation, freeze semantics, and snapshot invalidation/rebuild when routes are added before freeze.

@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.

123

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 6fb3416 into dev Apr 27, 2026
15 of 16 checks passed
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(routing): enforce or auto-enable compiled route snapshot for production hot path

1 participant