Skip to content

Add sort.py to microbenchmarks #6086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 8 additions & 1 deletion benches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ These are some files to determine performance of rustpython.
Running `cargo bench` from the root of the repository will start the benchmarks. Once done there will be a graphical
report under `target/criterion/report/index.html` that you can use use to view the results.

To view Python tracebacks during benchmarks, run `RUST_BACKTRACE=1 cargo bench`. You can also bench against a
`cargo bench` supports name matching to run a subset of the benchmarks. To
run only the sort microbenchmark, you can run:

```shell
cargo bench sort
```

To view Python tracebacks during benchmarks, run `RUST_BACKTRACE=1 cargo bench`. You can also bench against a
specific installed Python version by running:

```shell
Expand Down
7 changes: 7 additions & 0 deletions benches/microbenchmarks/sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from random import random

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

# ---

unsorted_list.sort()
Loading