Skip to content
Merged
Show file tree
Hide file tree
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
Refactor benchmarking suite to use Criterion
  • Loading branch information
orf committed Dec 11, 2020
commit 5788e7bf8e1e0019e47f24ad6521c5836f3b146e
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ flame.txt
flamescope.json
/wapm.lock
/wapm_packages
/.cargo/config
185 changes: 185 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ members = [
"derive", "jit", "parser", "vm", "vm/pylib-crate", "wasm/lib",
]

[[bench]]
name = "bench"
path = "./benchmarks/bench.rs"

[features]
default = ["threading", "pylib"]
flame-it = ["rustpython-vm/flame-it", "flame", "flamescope"]
Expand All @@ -43,11 +39,22 @@ libc = "0.2"
flame = { version = "0.2", optional = true }
flamescope = { version = "0.1", optional = true }

cpython = "0.5.0"

[target.'cfg(not(target_os = "wasi"))'.dependencies]
rustyline = "6.0"

[dev-dependencies]
cpython = "0.5.0"
criterion = "0.3"

[[bench]]
name = "parsing"
harness = false

[[bench]]
name = "execution"
harness = false

[[bin]]
name = "rustpython"
Expand All @@ -63,3 +70,5 @@ opt-level = 3
# crossbeam-utils = { git = "https://github.com/crossbeam-rs/crossbeam" }
# socket2 = { git = "https://github.com/alexcrichton/socket2-rs" }
# REDOX END

[target.bench]
38 changes: 38 additions & 0 deletions benches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Benchmarking

These are some files to determine performance of rustpython.

## Usage

Install pytest and pytest-benchmark:

$ pip install pytest-benchmark

Then run:

$ pytest

You can also benchmark the Rust benchmarks by just running
`cargo bench` from the root of the repository. To view Python tracebacks during benchmarks,
run `RUST_BACKTRACE=1 cargo bench`.

You can bench against a specific Python version by running:

```shell
$ PYTHON_SYS_EXECUTABLE=python3.7 cargo bench
```

On MacOS you will need to
add the following to a `.cargo/config` file:

```toml
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
```

## Benchmark source

- https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/nbody-python3-2.html
File renamed without changes.
File renamed without changes.
Loading