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

ContractExecutor changes #794

Merged
merged 3 commits into from
Sep 19, 2024
Merged

ContractExecutor changes #794

merged 3 commits into from
Sep 19, 2024

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Sep 16, 2024

Add option to never have debug names in functions and enable it on ContractExecutor, fix dangling temp library file

Checklist

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

…ntractExecutor, fix danling temp library file
@edg-l edg-l changed the title Add option to never have debug names in functions and enable it on Co… ContractExecutor changes Sep 16, 2024
@edg-l edg-l marked this pull request as ready for review September 16, 2024 11:30
@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 85.13514% with 11 lines in your changes missing coverage. Please review.

Project coverage is 88.70%. Comparing base (8faf10f) to head (10f48a4).

Files with missing lines Patch % Lines
src/executor/contract.rs 75.00% 5 Missing ⚠️
src/bin/cairo-native-compile.rs 0.00% 1 Missing ⚠️
src/bin/cairo-native-dump.rs 0.00% 1 Missing ⚠️
src/bin/cairo-native-run.rs 0.00% 1 Missing ⚠️
src/bin/cairo-native-stress/main.rs 0.00% 1 Missing ⚠️
src/bin/scarb-native-dump.rs 0.00% 1 Missing ⚠️
src/bin/utils/test.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #794   +/-   ##
=======================================
  Coverage   88.69%   88.70%           
=======================================
  Files         121      121           
  Lines       35512    35563   +51     
=======================================
+ Hits        31499    31546   +47     
- Misses       4013     4017    +4     

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

Copy link

github-actions bot commented Sep 16, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 8.839 ± 0.067 8.745 8.940 18.35 ± 0.16
cairo-native (embedded AOT) 3.149 ± 0.018 3.133 3.195 6.54 ± 0.05
cairo-native (embedded JIT using LLVM's ORC Engine) 3.165 ± 0.026 3.134 3.225 6.57 ± 0.06
cairo-native (standalone AOT) 0.655 ± 0.004 0.652 0.664 1.36 ± 0.01
cairo-native (standalone AOT with -march=native) 0.482 ± 0.002 0.480 0.487 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 8.756 ± 0.077 8.647 8.886 1075.58 ± 23.74
cairo-native (embedded AOT) 2.679 ± 0.027 2.643 2.728 329.11 ± 7.44
cairo-native (embedded JIT using LLVM's ORC Engine) 2.717 ± 0.057 2.665 2.801 333.73 ± 9.77
cairo-native (standalone AOT) 0.009 ± 0.001 0.008 0.017 1.05 ± 0.08
cairo-native (standalone AOT with -march=native) 0.008 ± 0.000 0.008 0.011 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.294 ± 0.022 4.268 4.334 63.84 ± 0.35
cairo-native (embedded AOT) 2.941 ± 0.029 2.911 3.009 43.72 ± 0.44
cairo-native (embedded JIT using LLVM's ORC Engine) 3.069 ± 0.019 3.043 3.102 45.62 ± 0.30
cairo-native (standalone AOT) 0.108 ± 0.000 0.108 0.109 1.61 ± 0.00
cairo-native (standalone AOT with -march=native) 0.067 ± 0.000 0.067 0.068 1.00

@edg-l edg-l added the review-ready A PR that is ready for review label Sep 16, 2024
Comment on lines +53 to 58
if is_for_contract_executor {
Cow::Owned(format!("f{}", function_id.id))
} else if let Some(name) = function_id.debug_name.as_deref() {
Cow::Owned(format!("{}(f{})", name, function_id.id))
} else {
Cow::Owned(format!("f{}", function_id.id))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the first if has the same behaviour as the else statement, may be it would be better to just remove it and just leave the if let {} else {} pattern?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not exactly the same, because if is_for_contract_executor is true, it will always be that branch, however removing that and just having the if let else will make the debug name have priority even if is_for_contract_executor is true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh, I see you point. Thanks.

@edg-l edg-l added this pull request to the merge queue Sep 19, 2024
Merged via the queue into main with commit 0eb9d45 Sep 19, 2024
12 checks passed
@edg-l edg-l deleted the contract_executor_fixes branch September 19, 2024 13:57
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.

5 participants