Skip to content

Commit

Permalink
Merge pull request #730 from Veykril/veykril/push-orlktsrpwzrv
Browse files Browse the repository at this point in the history
Don't load `verified_at` twice in `shallow_verify_memo`
  • Loading branch information
Veykril authored Feb 25, 2025
2 parents 7d417ac + 4b0d365 commit 447b371
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
10 changes: 9 additions & 1 deletion src/function/maybe_changed_after.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,15 @@ where
return true;
}

if memo.check_durability(zalsa) {
let last_changed = zalsa.last_changed_revision(memo.revisions.durability);
tracing::debug!(
"{database_key_index:?}: check_durability(memo = {memo:#?}, last_changed={:?} <= verified_at={:?}) = {:?}",
last_changed,
verified_at,
last_changed <= verified_at,
memo = memo.tracing_debug()
);
if last_changed <= verified_at {
// No input of the suitable durability has changed since last verified.
let db = db.as_dyn_database();
memo.mark_as_verified(
Expand Down
12 changes: 0 additions & 12 deletions src/function/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,6 @@ impl<V> Memo<V> {
revisions,
}
}
/// True if this memo is known not to have changed based on its durability.
pub(super) fn check_durability(&self, zalsa: &Zalsa) -> bool {
let last_changed = zalsa.last_changed_revision(self.revisions.durability);
let verified_at = self.verified_at.load();
tracing::debug!(
"check_durability(last_changed={:?} <= verified_at={:?}) = {:?}",
last_changed,
self.verified_at,
last_changed <= verified_at,
);
last_changed <= verified_at
}

/// Mark memo as having been verified in the `revision_now`, which should
/// be the current revision.
Expand Down

0 comments on commit 447b371

Please sign in to comment.