Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove gas accounting from AotContractExecutor #938

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

edg-l
Copy link
Collaborator

@edg-l edg-l commented Nov 21, 2024

Removes the initial gas cost calculations and substractions, the caller will handle it.

Checklist

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

@edg-l edg-l changed the title Add a initial_gas_cost parameter to AotContractExecutor and a helper constant (10k) Remove gas accounting from AotContractExecutor Nov 21, 2024
Copy link

github-actions bot commented Nov 21, 2024

✅ Code is now correctly formatted.

Copy link

github-actions bot commented Nov 21, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.998 ± 0.484 10.416 11.538 8.16 ± 0.36
cairo-native (embedded AOT) 3.291 ± 0.012 3.274 3.312 2.44 ± 0.01
cairo-native (embedded JIT using LLVM's ORC Engine) 3.107 ± 0.006 3.100 3.114 2.31 ± 0.01
cairo-native (standalone AOT with -march=native) 1.347 ± 0.002 1.345 1.351 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.690 ± 0.286 10.352 11.122 136.91 ± 3.87
cairo-native (embedded AOT) 2.872 ± 0.017 2.848 2.900 36.78 ± 0.40
cairo-native (embedded JIT using LLVM's ORC Engine) 2.672 ± 0.015 2.653 2.698 34.22 ± 0.37
cairo-native (standalone AOT with -march=native) 0.078 ± 0.001 0.077 0.079 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.318 ± 0.061 4.246 4.411 17.72 ± 0.49
cairo-native (embedded AOT) 3.136 ± 0.034 3.078 3.180 12.87 ± 0.34
cairo-native (embedded JIT using LLVM's ORC Engine) 3.077 ± 0.053 3.022 3.155 12.63 ± 0.37
cairo-native (standalone AOT with -march=native) 0.244 ± 0.006 0.242 0.262 1.00

Copy link

github-actions bot commented Nov 21, 2024

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 3.243 ± 0.030 3.211 3.288 1.00
base factorial_2M.cairo (AOT) 3.422 ± 0.036 3.374 3.479 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head factorial_2M.cairo (JIT) 3.200 ± 0.017 3.177 3.231 1.00
head factorial_2M.cairo (AOT) 3.388 ± 0.016 3.363 3.417 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 2.775 ± 0.028 2.727 2.825 1.00
base fib_2M.cairo (AOT) 2.970 ± 0.024 2.933 3.016 1.07 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head fib_2M.cairo (JIT) 2.761 ± 0.022 2.730 2.794 1.00
head fib_2M.cairo (AOT) 2.948 ± 0.016 2.927 2.968 1.07 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.077 ± 0.036 3.039 3.126 1.00
base logistic_map.cairo (AOT) 3.129 ± 0.023 3.091 3.161 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head logistic_map.cairo (JIT) 3.069 ± 0.022 3.039 3.098 1.00
head logistic_map.cairo (AOT) 3.119 ± 0.015 3.093 3.140 1.02 ± 0.01

@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.40%. Comparing base (107ff62) to head (ff8fa89).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #938      +/-   ##
==========================================
- Coverage   82.46%   82.40%   -0.07%     
==========================================
  Files         117      117              
  Lines       34392    34367      -25     
==========================================
- Hits        28362    28320      -42     
- Misses       6030     6047      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@edg-l edg-l added the review-ready A PR that is ready for review label Nov 25, 2024
src/executor/contract.rs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready A PR that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants