Skip to content

[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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MichaReiser
Copy link
Contributor

@MichaReiser MichaReiser commented Apr 11, 2025

Move the validate_maybe_provisional out of fetch_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.

Copy link

netlify bot commented Apr 11, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 57d4e67
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/67f8b63b410b0c000867ed0c

@MichaReiser MichaReiser force-pushed the fetch-hot-more-simplification branch from bfb1944 to 57d4e67 Compare April 11, 2025 06:27
Copy link

codspeed-hq bot commented Apr 11, 2025

CodSpeed Performance Report

Merging #793 will not alter performance

Comparing MichaReiser:fetch-hot-more-simplification (57d4e67) with master (77fdeaf)

Summary

✅ 12 untouched benchmarks

@MichaReiser MichaReiser added the refactoring Code works but is messy label Apr 11, 2025
@MichaReiser MichaReiser requested a review from carljm April 11, 2025 06:29
@MichaReiser MichaReiser marked this pull request as ready for review April 11, 2025 06:30
Copy link
Contributor

@carljm carljm left a 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()
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code works but is messy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants