Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
Jack O'Connor authored and jackoconnordev committed Aug 26, 2025
commit 1a4289c9debb9f71f844e399124551c2d184a5bb
9 changes: 9 additions & 0 deletions benches/microbenchmarks/sorted.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from random import random, seed
seed(0)

unsorted_list = [random() for _ in range(5 * ITERATIONS)]

# ---

# Setup code only runs once so do not modify in-place
sorted(unsorted_list)