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
517 stars 148 forks source link

Remove unecessary conversion functions between `Felt` & `BigUint`/`BigInt` #1562

Closed fmoletta closed 9 months ago

fmoletta commented 9 months ago

Closes #1495

github-actions[bot] commented 9 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.260 ± 0.007 2.247 2.272 1.00
head big_factorial 2.267 ± 0.016 2.244 2.303 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.243 ± 0.012 2.230 2.263 1.00 ± 0.01
head big_fibonacci 2.241 ± 0.013 2.230 2.267 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.259 ± 0.072 8.178 8.360 1.00
head blake2s_integration_benchmark 8.299 ± 0.151 8.217 8.711 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.295 ± 0.014 2.278 2.315 1.00
head compare_arrays_200000 2.302 ± 0.019 2.283 2.352 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.457 ± 0.004 1.452 1.464 1.00
head dict_integration_benchmark 1.459 ± 0.005 1.453 1.470 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.296 ± 0.023 1.284 1.359 1.00 ± 0.02
head field_arithmetic_get_square_benchmark 1.291 ± 0.007 1.285 1.307 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.286 ± 0.094 8.197 8.496 1.00 ± 0.01
head integration_builtins 8.272 ± 0.046 8.216 8.338 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.518 ± 0.059 8.457 8.602 1.00
head keccak_integration_benchmark 8.527 ± 0.045 8.470 8.609 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.330 ± 0.013 2.311 2.347 1.00
head linear_search 2.341 ± 0.020 2.322 2.385 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.573 ± 0.004 1.568 1.580 1.00 ± 0.00
head math_cmp_and_pow_integration_benchmark 1.571 ± 0.003 1.566 1.575 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.450 ± 0.013 1.437 1.475 1.01 ± 0.01
head math_integration_benchmark 1.440 ± 0.006 1.430 1.449 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.265 ± 0.020 1.254 1.320 1.00
head memory_integration_benchmark 1.270 ± 0.022 1.254 1.327 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.604 ± 0.006 1.596 1.615 1.00
head operations_with_data_structures_benchmarks 1.616 ± 0.023 1.598 1.670 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 605.6 ± 1.4 604.1 609.2 1.00
head pedersen 605.7 ± 1.9 603.0 609.0 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.070 ± 0.003 1.065 1.074 1.00 ± 0.01
head poseidon_integration_benchmark 1.068 ± 0.005 1.061 1.075 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.932 ± 0.006 1.923 1.943 1.00 ± 0.00
head secp_integration_benchmark 1.929 ± 0.006 1.920 1.938 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 750.7 ± 2.2 747.2 754.8 1.00
head set_integration_benchmark 751.5 ± 5.1 748.4 765.2 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.540 ± 0.025 4.513 4.586 1.00
head uint256_integration_benchmark 4.560 ± 0.048 4.517 4.675 1.00 ± 0.01
codecov[bot] commented 9 months ago

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (0ea638f) 97.12% compared to head (8385994) 97.13%.

Files Patch % Lines
...int_processor/builtin_hint_processor/math_utils.rs 84.84% 5 Missing :warning:
...sor/cairo_1_hint_processor/hint_processor_utils.rs 40.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1562 +/- ## ======================================= Coverage 97.12% 97.13% ======================================= Files 91 91 Lines 37245 37263 +18 ======================================= + Hits 36175 36196 +21 + Misses 1070 1067 -3 ```

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