Skip to content

Commit c0f36c4

Browse files
rodrigobnogueirarodrigo.nogueira
andauthored
Fix logic bugs in benchmarks: correct cache miss counting and concurrent loop (#733)
Co-authored-by: rodrigo.nogueira <[email protected]>
1 parent 4232c3f commit c0f36c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmark.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def test_cache_miss_benchmark(
175175
) -> None:
176176
func = factory()
177177
# Use 2048 objects (16x maxsize=128) to force evictions and measure actual misses
178-
unique_objects = [object() for _ in range(128)]
178+
unique_objects = [object() for _ in range(2048)]
179179

180180
async def run() -> None:
181181
for obj in unique_objects:
@@ -262,7 +262,7 @@ def test_concurrent_cache_hit_benchmark(
262262
async def gather_coros():
263263
gather = asyncio.gather
264264
for _ in range(10):
265-
return await gather(*map(func, keys))
265+
await gather(*map(func, keys))
266266

267267
benchmark(run_loop, gather_coros)
268268

0 commit comments

Comments
 (0)