[refactor] More fetch_hot simplification#793
Merged
MichaReiser merged 2 commits intosalsa-rs:masterfrom Apr 23, 2025
Merged
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
bfb1944 to
57d4e67
Compare
CodSpeed Performance ReportMerging #793 will not alter performanceComparing Summary
|
carljm
reviewed
Apr 12, 2025
Contributor
carljm
left a comment
There was a problem hiding this comment.
I agree this is nicer, since it means only validate_may_be_provisional has to know/care about validate_same_iteration
| // Wouldn't it be nice if rust had an implication operator ... | ||
| // may_be_provisional -> validate_provisional | ||
| !memo.may_be_provisional() || self.validate_provisional(db, zalsa, database_key_index, memo) | ||
| !memo.may_be_provisional() |
Contributor
There was a problem hiding this comment.
The doc comment for this method (above and unchanged in the PR, so I can't inline-comment on it directly) needs to be updated to mention the same-iteration caveat.
carljm
approved these changes
Apr 12, 2025
57d4e67 to
eaa5c74
Compare
Merged
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.
Move the
validate_maybe_provisionalout offetch_hotand only test if the memo is provisional (in which case we shouldn't mark the memo as updated).Rely on
fetch_coldto lazily validate the memo.Codspeed thinks this is slightly better in some benchmarks (but the results change between runs). There's no meaningful change in Red Knot's benchmarks. I think it simplifies the logic a tiny bit. But I'm also okay not landing this change.