Skip to content

Commit 338b462

Browse files
author
Jack O'Connor
committed
Add microbenchmark for sorted
I chose 5 * Iterations to try better show that RustPython sort implementation scales noticeably worse CPython's with respect to the number of elements.
1 parent a9a9e3b commit 338b462

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

benches/microbenchmarks/sort.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from random import random
2+
3+
unsorted_list = [random() for _ in range(5 * ITERATIONS)]
4+
5+
# ---
6+
7+
unsorted_list.sort()

0 commit comments

Comments
 (0)