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 std::mem::forget(arena) on invoke_dynamic #725

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Jul 9, 2024

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 Remove memory leak on invoke arena Remove memory leak on invoke_dynamic arena Jul 9, 2024
@edg-l edg-l changed the title Remove memory leak on invoke_dynamic arena Remove std::mem::forget(arena) on invoke_dynamic Jul 9, 2024
@edg-l edg-l marked this pull request as ready for review July 9, 2024 10:29
@edg-l edg-l added the review-ready A PR that is ready for review label Jul 9, 2024
Copy link

github-actions bot commented Jul 9, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.238 ± 0.049 11.175 11.312 23.42 ± 0.10
cairo-native (embedded AOT) 1.490 ± 0.008 1.480 1.504 3.10 ± 0.02
cairo-native (embedded JIT using LLVM's ORC Engine) 1.576 ± 0.014 1.563 1.607 3.28 ± 0.03
cairo-native (standalone AOT) 0.653 ± 0.001 0.651 0.655 1.36 ± 0.00
cairo-native (standalone AOT with -march=native) 0.480 ± 0.000 0.479 0.481 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.667 ± 0.038 10.626 10.735 1311.90 ± 17.86
cairo-native (embedded AOT) 1.073 ± 0.006 1.063 1.080 131.99 ± 1.87
cairo-native (embedded JIT using LLVM's ORC Engine) 1.098 ± 0.010 1.084 1.111 134.99 ± 2.18
cairo-native (standalone AOT) 0.008 ± 0.000 0.008 0.009 1.04 ± 0.02
cairo-native (standalone AOT with -march=native) 0.008 ± 0.000 0.008 0.009 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 1.880 ± 0.009 1.871 1.898 28.47 ± 0.15
cairo-native (embedded AOT) 1.220 ± 0.007 1.210 1.232 18.48 ± 0.11
cairo-native (embedded JIT using LLVM's ORC Engine) 1.397 ± 0.014 1.388 1.434 21.16 ± 0.22
cairo-native (standalone AOT) 0.107 ± 0.000 0.107 0.108 1.62 ± 0.01
cairo-native (standalone AOT with -march=native) 0.066 ± 0.000 0.066 0.066 1.00

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.68%. Comparing base (9527cc9) to head (37a64fd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #725      +/-   ##
==========================================
- Coverage   91.68%   91.68%   -0.01%     
==========================================
  Files         118      118              
  Lines       32644    32642       -2     
==========================================
- Hits        29931    29929       -2     
  Misses       2713     2713              

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

Copy link
Member

@pefontana pefontana left a comment

Choose a reason for hiding this comment

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

Can we add a test to replicate the bug?
Or why are we adding this?

@edg-l
Copy link
Member Author

edg-l commented Jul 10, 2024

Can we add a test to replicate the bug? Or why are we adding this?

We are not adding anything we are removing it. It was a hack to fix a segfault before and now its not needed, no segfault happens without the line.

@juanbono juanbono enabled auto-merge July 10, 2024 11:49
@juanbono juanbono added this pull request to the merge queue Jul 10, 2024
Merged via the queue into main with commit dee197a Jul 10, 2024
9 checks passed
@juanbono juanbono deleted the try_remove_memforget_arena branch July 10, 2024 12:48
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