-
Notifications
You must be signed in to change notification settings - Fork 170
[refactor] More fetch_hot
simplification
#793
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
base: master
Are you sure you want to change the base?
[refactor] More fetch_hot
simplification
#793
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
bfb1944
to
57d4e67
Compare
CodSpeed Performance ReportMerging #793 will not alter performanceComparing Summary
|
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 agree this is nicer, since it means only validate_may_be_provisional
has to know/care about validate_same_iteration
@@ -252,7 +252,9 @@ where | |||
) -> bool { | |||
// 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() |
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.
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.
Move the
validate_maybe_provisional
out offetch_hot
and only test if the memo is provisional (in which case we shouldn't mark the memo as updated).Rely on
fetch_cold
to 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.