We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4e713b commit 151c09cCopy full SHA for 151c09c
1 file changed
benchmark.py
@@ -136,7 +136,8 @@ def test_cache_miss_benchmark(
136
run_loop: Callable[..., Any],
137
func: _LRUCacheWrapper[Any],
138
) -> None:
139
- unique_objects = [object() for _ in range(128)]
+ # Use 2048 objects (16x maxsize=128) to force evictions and measure actual misses
140
+ unique_objects = [object() for _ in range(2048)]
141
func.cache_clear()
142
143
async def run() -> None:
@@ -222,7 +223,7 @@ def test_concurrent_cache_hit_benchmark(
222
223
async def gather_coros():
224
gather = asyncio.gather
225
for _ in range(10):
- return await gather(*map(func, keys))
226
+ await gather(*map(func, keys))
227
228
benchmark(run_loop, gather_coros)
229
0 commit comments