Skip to content

Commit 76c71aa

Browse files
committed
fix benchmark
1 parent c2fbb9c commit 76c71aa

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/benchmark/test_memory_benchmark.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,20 +260,22 @@ def test_manifest_cache_deduplication_efficiency() -> None:
260260

261261
# Analyze cache efficiency
262262
cache_entries = len(_manifest_cache)
263+
# List i contains manifests 0..i, so only the first num_lists manifests are actually used
264+
manifests_actually_used = num_lists
263265

264266
print("\nResults:")
265267
print(f" Manifest lists created: {num_lists}")
266-
print(f" Total unique manifest files: {num_manifests}")
268+
print(f" Manifest files created: {num_manifests}")
269+
print(f" Manifest files actually used: {manifests_actually_used}")
267270
print(f" Cache entries: {cache_entries}")
268271

269-
# With efficient per-ManifestFile caching, we should have at most
270-
# num_manifests entries (one per unique manifest path), not
271-
# sum(1..num_lists) entries as with the old strategy
272-
print(f"\n Expected cache entries (efficient): <= {num_manifests}")
272+
# With efficient per-ManifestFile caching, we should have exactly
273+
# manifests_actually_used entries (one per unique manifest path)
274+
print(f"\n Expected cache entries (efficient): {manifests_actually_used}")
273275
print(f" Actual cache entries: {cache_entries}")
274276

275277
# The cache should be efficient - one entry per unique manifest path
276-
assert cache_entries <= num_manifests + num_lists, (
277-
f"Cache has {cache_entries} entries, expected at most {num_manifests + num_lists}. "
278+
assert cache_entries == manifests_actually_used, (
279+
f"Cache has {cache_entries} entries, expected exactly {manifests_actually_used}. "
278280
"The cache may not be deduplicating properly."
279281
)

0 commit comments

Comments
 (0)