Skip to content

Commit 50a366c

Browse files
committed
more docs
1 parent 1f5861b commit 50a366c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/benchmark/test_memory_benchmark.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def test_manifest_cache_memory_growth(memory_catalog: InMemoryCatalog) -> None:
121121
# Memory growth includes ManifestFile objects, metadata, and other overhead
122122
# We expect about 5-10 KB per iteration for typical workloads
123123
# The key improvement is that growth is O(N) not O(N²)
124+
# Threshold of 15KB/iteration based on observed behavior - O(N²) would show ~50KB+/iteration
124125
assert growth_per_iteration < 15000, (
125126
f"Memory growth per iteration ({growth_per_iteration:.0f} bytes) is too high. "
126127
"This may indicate the O(N²) cache inefficiency is present."
@@ -168,6 +169,10 @@ def test_memory_after_gc_with_cache_cleared(memory_catalog: InMemoryCatalog) ->
168169
print("\nResults:")
169170
print(f" Memory reclaimed by clearing cache: {memory_reclaimed / 1024:.1f} KB")
170171

172+
# Verify that clearing the cache actually freed some memory
173+
# Note: This may be flaky in some environments due to GC behavior
174+
assert memory_reclaimed >= 0, "Memory should not increase after clearing cache"
175+
171176

172177
@pytest.mark.benchmark
173178
def test_manifest_cache_deduplication_efficiency() -> None:

0 commit comments

Comments
 (0)