pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/RustPython/RustPython/tree/main/benches

"anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-b55097560d244c08.css" /> RustPython/benches at main · RustPython/RustPython · GitHub
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Benchmarking

These are some files to determine performance of rustpython.

Usage

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.

cargo bench supports name matching to run a subset of the benchmarks. To run only the sorted microbenchmark, you can run:

cargo bench sorted

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

PYTHON_SYS_EXECUTABLE=python3.13 cargo bench

Adding a benchmark

Simply adding a file to the benchmarks/ directory will add it to the set of files benchmarked. Each file is tested in two ways:

  1. The time to parse the file to AST
  2. The time it takes to execute the file

Adding a micro benchmark

Micro benchmarks are small snippets of code added under the microbenchmarks/ directory. A microbenchmark file has two sections:

  1. Optional setup code
  2. The code to be benchmarked

These two sections are delimited by # ---. For example:

a_list = [1,2,3]

# ---

len(a_list)

Only len(a_list) will be timed. Setup or benchmarked code can optionally reference a variable called ITERATIONS. If present then the benchmark code will be invoked 5 times with ITERATIONS set to a value between 100 and 1,000. For example:

obj = [i for i in range(ITERATIONS)]

ITERATIONS can appear in both the setup code and the benchmark code.

MacOS setup

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

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

Benchmark source

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy