Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Router Sync without breaking the API #2481

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Conversation

jplatte
Copy link
Member

@jplatte jplatte commented Jan 2, 2024

Motivation

#2476 is currently based on #2473, which is a breaking change. Thus, we can't ship it in a patch release for 0.7 to recover performance of existing apps that have upgraded to axum 0.7.

Solution

Use Mutexes in a few places that only ever actually need to be locked for cloning, to make Router Sync and enable #2476 to be merged as a non-breaking change. For axum 0.8, we can then revert this PR as part of #2473.

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

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

Nice!

Probably worth benchmarking and comparing against #2473 but I'm pretty sure we just end up cloning the one Route we actually call so the short lock shouldn't matter.

@davidpdrsn davidpdrsn merged commit af13c53 into main Jan 2, 2024
18 checks passed
@davidpdrsn davidpdrsn deleted the jplatte/sync-0.7 branch January 2, 2024 19:18
@davidpdrsn
Copy link
Member

I'm gonna redo #2476 on top of these changes.

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.

2 participants