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
485 stars 133 forks source link

refactor: Remove unused code & use constants whenever possible for builtin instance definitions #1707

Closed fmoletta closed 2 months ago

fmoletta commented 2 months ago

Builtin Instance Defs

github-actions[bot] commented 2 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.325 ± 0.059 2.268 2.458 1.01 ± 0.03
head big_factorial 2.306 ± 0.023 2.268 2.347 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.305 ± 0.036 2.266 2.374 1.01 ± 0.02
head big_fibonacci 2.292 ± 0.031 2.255 2.355 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.587 ± 0.187 8.299 8.740 1.01 ± 0.03
head blake2s_integration_benchmark 8.478 ± 0.148 8.308 8.700 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.344 ± 0.024 2.313 2.397 1.00
head compare_arrays_200000 2.349 ± 0.039 2.321 2.452 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.474 ± 0.018 1.454 1.512 1.01 ± 0.02
head dict_integration_benchmark 1.465 ± 0.018 1.446 1.495 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.325 ± 0.023 1.302 1.385 1.01 ± 0.02
head field_arithmetic_get_square_benchmark 1.314 ± 0.012 1.295 1.333 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.532 ± 0.194 8.334 8.787 1.01 ± 0.03
head integration_builtins 8.438 ± 0.155 8.318 8.714 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.949 ± 0.436 8.539 10.047 1.01 ± 0.06
head keccak_integration_benchmark 8.879 ± 0.237 8.658 9.492 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.376 ± 0.053 2.336 2.523 1.01 ± 0.03
head linear_search 2.364 ± 0.048 2.323 2.434 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.585 ± 0.013 1.563 1.599 1.00
head math_cmp_and_pow_integration_benchmark 1.596 ± 0.029 1.566 1.664 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.426 ± 0.015 1.409 1.444 1.00
head math_integration_benchmark 1.446 ± 0.027 1.413 1.485 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.289 ± 0.034 1.254 1.354 1.00 ± 0.03
head memory_integration_benchmark 1.283 ± 0.028 1.249 1.342 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.614 ± 0.016 1.592 1.652 1.00
head operations_with_data_structures_benchmarks 1.618 ± 0.016 1.602 1.651 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 591.6 ± 4.2 587.5 601.6 1.00
head pedersen 594.2 ± 4.1 590.5 603.1 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 972.2 ± 7.9 964.0 989.6 1.01 ± 0.01
head poseidon_integration_benchmark 962.1 ± 4.9 952.2 968.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.870 ± 0.013 1.856 1.899 1.00
head secp_integration_benchmark 1.879 ± 0.015 1.867 1.911 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 721.4 ± 1.0 719.8 722.9 1.00
head set_integration_benchmark 721.4 ± 4.6 716.0 730.8 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.734 ± 0.107 4.620 4.941 1.01 ± 0.03
head uint256_integration_benchmark 4.700 ± 0.054 4.612 4.823 1.00
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 96.27329% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 94.94%. Comparing base (6de8f56) to head (0f6870a).

Files Patch % Lines
vm/src/vm/runners/builtin_runner/modulo.rs 0.00% 8 Missing :warning:
vm/src/vm/runners/builtin_runner/mod.rs 97.43% 2 Missing :warning:
vm/src/vm/runners/builtin_runner/bitwise.rs 96.00% 1 Missing :warning:
vm/src/vm/runners/cairo_runner.rs 95.65% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1707 +/- ## ========================================== - Coverage 94.98% 94.94% -0.05% ========================================== Files 99 98 -1 Lines 38579 38081 -498 ========================================== - Hits 36646 36155 -491 + Misses 1933 1926 -7 ```

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