Skip to content

Commit 7e68e1b

Browse files
authored
Make benchmarks for getall more stable (#1189)
Standard deviation for some benchmarks is too high, to reduce it the PR runs the test 30 times.
1 parent 8303397 commit 7e68e1b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_multidict_benchmarks.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ def test_multidict_getall_str_hit(
261261

262262
@benchmark
263263
def _run() -> None:
264-
md.getall("key3")
264+
for i in range(30):
265+
md.getall("key3")
265266

266267

267268
def test_multidict_getall_str_miss(
@@ -273,7 +274,8 @@ def test_multidict_getall_str_miss(
273274

274275
@benchmark
275276
def _run() -> None:
276-
md.getall("miss", ())
277+
for i in range(30):
278+
md.getall("miss", ())
277279

278280

279281
def test_cimultidict_getall_istr_hit(
@@ -287,7 +289,8 @@ def test_cimultidict_getall_istr_hit(
287289

288290
@benchmark
289291
def _run() -> None:
290-
md.getall(all_istr)
292+
for i in range(30):
293+
md.getall(all_istr)
291294

292295

293296
def test_cimultidict_getall_istr_miss(
@@ -301,7 +304,8 @@ def test_cimultidict_getall_istr_miss(
301304

302305
@benchmark
303306
def _run() -> None:
304-
md.getall(miss_istr, ())
307+
for i in range(30):
308+
md.getall(miss_istr, ())
305309

306310

307311
def test_multidict_fetch(

0 commit comments

Comments
 (0)