lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
518 stars 148 forks source link

ci: run tests with optimizations #1520

Closed Oppen closed 10 months ago

Oppen commented 10 months ago

This saves a lot of execution time and, in the case of coverage builds, disk space. O2 seems to give good results, so I'm going with it. Local tests on a development machine:

PROFILE  BUILD TIME  RUN TIME COV ARTIFACTS
NONE 61s 112s N/A
O1 193s 16s N/A
O2 190s 13s N/A
O3 192s 12s N/A
Os 126s 14s N/A
Oz 138s 21s N/A
COV 68s 451s 90GB
COV+O1 182s 130s 93GB
COV+O2 204s 95s 69GB
COV+O3 208s 98s 69GB
COV+Os 180s 131s 93GB
COV+Oz 157s 140s 93GB

On CI first run (invalidated cache) tests take about 9-10 minutes per shard. This seems stable too afterwards, which makes sense since most time seems to be spent linking the binaries rather than compiling dependencies, and artifacts local to the project aren't cached by rust-cache.

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (8a2ef24) 96.82% compared to head (183dde5) 96.82%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1520 +/- ## ======================================= Coverage 96.82% 96.82% ======================================= Files 96 96 Lines 39744 39744 ======================================= Hits 38482 38482 Misses 1262 1262 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 10 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.849 ± 0.019 2.826 2.891 1.00
head big_factorial 2.914 ± 0.037 2.873 2.976 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.450 ± 0.049 2.408 2.576 1.00
head big_fibonacci 2.492 ± 0.014 2.468 2.513 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.007 ± 0.041 6.943 7.071 1.00
head blake2s_integration_benchmark 7.031 ± 0.042 6.990 7.130 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.557 ± 0.026 2.521 2.609 1.00
head compare_arrays_200000 2.619 ± 0.027 2.571 2.663 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.708 ± 0.009 1.701 1.727 1.00
head dict_integration_benchmark 1.745 ± 0.010 1.724 1.762 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.205 ± 0.017 1.188 1.236 1.00
head field_arithmetic_get_square_benchmark 1.208 ± 0.014 1.192 1.234 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.107 ± 0.218 6.979 7.551 1.00
head integration_builtins 7.127 ± 0.205 6.989 7.660 1.00 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.125 ± 0.020 7.102 7.155 1.00
head keccak_integration_benchmark 7.141 ± 0.027 7.111 7.190 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.602 ± 0.036 2.564 2.697 1.00
head linear_search 2.643 ± 0.029 2.619 2.718 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.719 ± 0.023 1.696 1.764 1.00
head math_cmp_and_pow_integration_benchmark 1.744 ± 0.028 1.718 1.811 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.634 ± 0.011 1.621 1.652 1.00
head math_integration_benchmark 1.663 ± 0.011 1.642 1.678 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.445 ± 0.013 1.427 1.461 1.00
head memory_integration_benchmark 1.491 ± 0.023 1.464 1.535 1.03 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.578 ± 0.020 1.557 1.629 1.00
head operations_with_data_structures_benchmarks 1.595 ± 0.012 1.579 1.612 1.01 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 620.8 ± 6.3 615.8 638.0 1.00
head pedersen 624.0 ± 2.2 621.6 628.3 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.185 ± 0.005 1.179 1.198 1.00
head poseidon_integration_benchmark 1.198 ± 0.005 1.188 1.207 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.128 ± 0.016 2.112 2.164 1.00
head secp_integration_benchmark 2.163 ± 0.008 2.155 2.179 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.186 ± 0.009 1.174 1.208 1.00
head set_integration_benchmark 1.189 ± 0.004 1.184 1.194 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.384 ± 0.015 4.356 4.411 1.00
head uint256_integration_benchmark 4.413 ± 0.041 4.372 4.497 1.01 ± 0.01