-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
#!/usr/bin/env sh | ||
tests_path="../cairo_programs/benchmarks" | ||
tests_path="cairo_programs/benchmarks" | ||
trace_enabled=${1:-false} | ||
|
||
set -e | ||
|
||
source ../cairo-rs-py/scripts/cairo-rs-py/bin/activate | ||
|
||
for input_file in "$tests_path"/*.cairo; do | ||
if [ -f "$input_file" ]; then | ||
output_file="${input_file%.cairo}.json" | ||
cairo-compile --cairo_path="cairo_programs" "$input_file" --output "$output_file" | ||
echo "Compiled $input_file to $output_file" | ||
fi | ||
done | ||
|
||
deactivate | ||
|
||
for file in $(ls $tests_path | grep .cairo | sed -E 's/\.cairo//'); do | ||
echo "Running $file benchmark" | ||
|
||
export PATH="$(pyenv root)/shims:$PATH" | ||
|
||
hyperfine \ | ||
-n "Cairo VM (CPython)" "PYENV_VERSION=3.7.12 cairo-run --layout all --program $tests_path/$file.json" \ | ||
-n "Cairo VM (PyPy)" "PYENV_VERSION=pypy3.7-7.3.9 cairo-run --layout all --program $tests_path/$file.json" \ | ||
-n "cairo-rs (Rust)" "../target/release/cairo-rs-run $tests_path/$file.json --layout all" | ||
if [ "$trace_enabled" = true ]; then | ||
hyperfine -w 0 -r 2 -i --show-output \ | ||
-n "Cairo VM (CPython)" "source ../cairo-rs-py/scripts/cairo-lang/bin/activate && cairo-run --layout all --program $tests_path/$file.json --trace_file $tests_path/$file.trace" \ | ||
-n "Cairo VM (PyPy)" "source ../cairo-rs-py/scripts/cairo-rs-pypy/bin/activate && cairo-run --layout all --program $tests_path/$file.json --trace_file $tests_path/$file.trace" \ | ||
-n "cairo-rs (Rust)" "target/release/cairo-rs-run $tests_path/$file.json --layout all --trace_file $tests_path/$file.trace" | ||
else | ||
hyperfine -w 0 -r 2 -i --show-output \ | ||
-n "Cairo VM (CPython)" "source ../cairo-rs-py/scripts/cairo-lang/bin/activate && cairo-run --layout all --program $tests_path/$file.json" \ | ||
-n "Cairo VM (PyPy)" "source ../cairo-rs-py/scripts/cairo-rs-pypy/bin/activate && cairo-run --layout all --program $tests_path/$file.json" \ | ||
-n "cairo-rs (Rust)" "target/release/cairo-rs-run $tests_path/$file.json --layout all" | ||
fi | ||
done | ||
|
||
|
72eed98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.30
.cairo_run(cairo_programs/benchmarks/compare_arrays_200000.json)
829489525
ns/iter (± 50680745
)637231489
ns/iter (± 1969874
)1.30
cairo_run(cairo_programs/benchmarks/keccak_integration_benchmark.json)
1729917678
ns/iter (± 83291756
)1240800087
ns/iter (± 8607617
)1.39
cairo_run(cairo_programs/benchmarks/secp_integration_benchmark.json)
1916670920
ns/iter (± 25576369
)1348564409
ns/iter (± 2660517
)1.42
cairo_run(cairo_programs/benchmarks/blake2s_integration_benchmark.json)
1520645618
ns/iter (± 40201880
)1082080349
ns/iter (± 8505744
)1.41
This comment was automatically generated by workflow using github-action-benchmark.
CC: @unbalancedparentheses