perf: defer database attachment for cached queries#1177
Draft
MichaReiser wants to merge 1 commit into
Draft
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
Merging this PR will degrade performance by 7.77%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Contributor
Author
|
huh |
3ad7814 to
2f79db2
Compare
b3b0f5a to
f226c44
Compare
2188fa7 to
4ef0944
Compare
MichaReiser
added a commit
to astral-sh/ruff
that referenced
this pull request
Jun 23, 2026
MichaReiser
added a commit
to astral-sh/ruff
that referenced
this pull request
Jun 23, 2026
database.as_dyn_database call
4ef0944 to
57155d4
Compare
database.as_dyn_database call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defer database attachment until a tracked query takes a cold path, so cached top-level and nested queries avoid repeated TLS guard work.
Event callbacks, tracing, cancellation cleanup, and query execution still run with the database attached; mismatched databases continue to panic.
Testing: Passed the full test suite and all-features checks.