Skip to content

Conversation

@fmoletta
Copy link
Contributor

Currently, if original steps is not set and trace is not enabled the number of steps in the ExecutionResources returned by CairoRunner::get_execution_resources is always 0. There are cases, such as starknet_in_rust, where execution resources are used but there is no use for the trace. In order to not slow down other projects that have no use for the trace, CairoRunner::get_execution_resources will now use vm.current_step as n_steps if original steps or trace are not available

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Merging #1222 (b47fdbf) into main (8e022a1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1222   +/-   ##
=======================================
  Coverage   97.59%   97.59%           
=======================================
  Files          89       89           
  Lines       36166    36201   +35     
=======================================
+ Hits        35296    35331   +35     
  Misses        870      870           
Impacted Files Coverage Δ
src/vm/runners/cairo_runner.rs 97.99% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

github-actions bot commented Jun 12, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 11.377 ± 0.132 11.180 11.577 1.00 ± 0.01
head blake2s_integration_benchmark 11.355 ± 0.107 11.192 11.542 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.746 ± 0.038 3.704 3.803 1.00 ± 0.01
head compare_arrays_200000 3.743 ± 0.029 3.713 3.804 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.500 ± 0.050 2.471 2.639 1.00 ± 0.02
head dict_integration_benchmark 2.489 ± 0.032 2.467 2.575 1.00
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 3.889 ± 0.041 3.846 3.995 1.00
head factorial_multirun 3.905 ± 0.019 3.870 3.936 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 3.362 ± 0.026 3.332 3.421 1.00
head fibonacci_1000_multirun 3.365 ± 0.026 3.338 3.424 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 164.4 ± 1.5 162.1 166.9 1.00
head field_arithmetic_get_square_benchmark 164.8 ± 1.0 163.2 166.4 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 10.089 ± 0.184 9.928 10.527 1.00
head integration_builtins 10.188 ± 0.105 10.062 10.359 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 11.631 ± 0.203 11.367 12.008 1.00
head keccak_integration_benchmark 12.243 ± 2.266 11.336 18.670 1.05 ± 0.20
Command Mean [s] Min [s] Max [s] Relative
base linear_search 5.997 ± 6.360 3.732 24.029 1.59 ± 1.69
head linear_search 3.764 ± 0.025 3.738 3.822 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.616 ± 0.039 2.580 2.706 1.00 ± 0.02
head math_cmp_and_pow_integration_benchmark 2.606 ± 0.025 2.578 2.642 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.438 ± 0.017 2.412 2.460 1.00 ± 0.01
head math_integration_benchmark 2.432 ± 0.019 2.407 2.461 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.127 ± 0.011 2.112 2.144 1.00 ± 0.01
head memory_integration_benchmark 2.127 ± 0.010 2.115 2.149 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.451 ± 0.015 2.421 2.478 1.00 ± 0.01
head operations_with_data_structures_benchmarks 2.442 ± 0.011 2.428 2.464 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 866.1 ± 2.7 863.1 870.7 1.00
head pedersen 869.6 ± 7.0 861.5 880.9 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.616 ± 0.016 1.603 1.660 1.00 ± 0.01
head poseidon_integration_benchmark 1.613 ± 0.013 1.601 1.637 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.810 ± 0.019 2.785 2.851 1.00
head secp_integration_benchmark 2.817 ± 0.031 2.792 2.896 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.442 ± 0.007 1.429 1.450 1.00
head set_integration_benchmark 1.448 ± 0.044 1.425 1.570 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 7.118 ± 0.069 7.053 7.296 1.00 ± 0.01
head uint256_integration_benchmark 7.116 ± 0.040 7.067 7.188 1.00

@fmoletta fmoletta marked this pull request as ready for review June 12, 2023 15:41
@pefontana pefontana enabled auto-merge June 12, 2023 19:53
@pefontana pefontana added this pull request to the merge queue Jun 12, 2023
Merged via the queue into main with commit e87dfa0 Jun 12, 2023
@pefontana pefontana deleted the n-steps-no-trace branch June 12, 2023 20:38
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
…lass#1222)

* Get n_steps without using trace

* Add cahngelog entry

---------

Co-authored-by: Pedro Fontana <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants