File tree 5 files changed +108
-2067
lines changed 5 files changed +108
-2067
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,6 @@ rustyline = "6.0"
46
46
cpython = " 0.5.0"
47
47
criterion = " 0.3"
48
48
49
- [[bench ]]
50
- name = " parsing"
51
- harness = false
52
-
53
49
[[bench ]]
54
50
name = " execution"
55
51
harness = false
Original file line number Diff line number Diff line change @@ -4,26 +4,27 @@ These are some files to determine performance of rustpython.
4
4
5
5
## Usage
6
6
7
- Install pytest and pytest-benchmark:
7
+ Running ` cargo bench ` from the root of the repository will start the benchmarks. Once done there will be a graphical
8
+ report under ` target/critierion/report/index.html ` that you can use use to view the results.
8
9
9
- $ pip install pytest-benchmark
10
+ To view Python tracebacks during benchmarks, run ` RUST_BACKTRACE=1 cargo bench ` . You can also bench against a
11
+ specific installed Python version by running:
10
12
11
- Then run:
13
+ ``` shell
14
+ $ PYTHON_SYS_EXECUTABLE=python3.7 cargo bench
15
+ ```
12
16
13
- $ pytest
17
+ ### Adding a benchmark
14
18
15
- You can also benchmark the Rust benchmarks by just running
16
- ` cargo bench ` from the root of the repository. To view Python tracebacks during benchmarks,
17
- run ` RUST_BACKTRACE=1 cargo bench ` .
19
+ Simply adding a file to the ` benchmarks/ ` directory will add it to the set of files benchmarked. Each file is tested
20
+ in two ways:
18
21
19
- You can bench against a specific Python version by running:
22
+ 1 . The time to parse the file to AST
23
+ 2 . The time it takes to execute the file
20
24
21
- ``` shell
22
- $ PYTHON_SYS_EXECUTABLE=python3.7 cargo bench
23
- ```
25
+ ## MacOS setup
24
26
25
- On MacOS you will need to
26
- add the following to a ` .cargo/config ` file:
27
+ On MacOS you will need to add the following to a ` .cargo/config ` file:
27
28
28
29
``` toml
29
30
[target .x86_64-apple-darwin ]
You can’t perform that action at this time.
0 commit comments