-
Notifications
You must be signed in to change notification settings - Fork 175
Add fetch span #875
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
Add fetch span #875
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #875 will not alter performanceComparing Summary
|
Hmm, perf is definetely regressing :( |
@@ -15,14 +15,17 @@ where | |||
let (zalsa, zalsa_local) = db.zalsas(); | |||
zalsa.unwind_if_revision_cancelled(zalsa_local); | |||
|
|||
let database_key_index = self.database_key_index(id); | |||
let _span = tracing::debug_span!("fetch", query = ?database_key_index).entered(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume its just the allocation and deallocation of the span causing the perf regression but could you try using a query = ?{database_key_index}
to force a move? (or inline the local into the method call). Rust's formatting infra captures the address of things which may inhibit optimizations.
@@ -15,14 +15,18 @@ where | |||
let (zalsa, zalsa_local) = db.zalsas(); | |||
zalsa.unwind_if_revision_cancelled(zalsa_local); | |||
|
|||
let database_key_index = self.database_key_index(id); | |||
#[cfg(debug_assertions)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sort of defeats the purpose of tracing but I hopefully will never have to debug release-mode only salsa bugs
I often find it hard to understand the query stack when debugging salsa.
This PR adds a
fetch
span, including the ingredient. This gives a better sense for how salsa recurses and (when enter and exit logging is enabled), when a query completes.This is a separate PR to see how it affects perf:
Example from a recent debugging sesison of mine (the thread id part is custom)