From f51f6068132c02a52f08b37eb135546adf2e23a3 Mon Sep 17 00:00:00 2001 From: hardfist Date: Sat, 9 May 2026 18:14:15 +0800 Subject: [PATCH 1/2] perf: compare cached path hash before path --- src/cache.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache.rs b/src/cache.rs index 8d54f362..d3afb88b 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -117,7 +117,7 @@ impl Hash for CachedPath { impl PartialEq for CachedPath { fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path + self.0.hash == other.0.hash && self.0.path == other.0.path } } impl Eq for CachedPath {} From fa0ba0293e5f3ad9e7517039747f699d3277ca74 Mon Sep 17 00:00:00 2001 From: hardfist Date: Sat, 9 May 2026 18:48:59 +0800 Subject: [PATCH 2/2] perf: compare cache key hash before path --- src/cache.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cache.rs b/src/cache.rs index d3afb88b..47dc4d3d 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -390,7 +390,9 @@ impl Hash for dyn CacheKey + '_ { impl PartialEq for dyn CacheKey + '_ { fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 + let (self_hash, self_path) = self.tuple(); + let (other_hash, other_path) = other.tuple(); + self_hash == other_hash && self_path == other_path } }