-
Notifications
You must be signed in to change notification settings - Fork 49
Add reference counting for circuit_outputs dynamic array #1419
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
base: main
Are you sure you want to change the base?
Conversation
Benchmark results Main vs HEAD.Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
|
Benchmarking resultsBenchmark for program
|
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
10.933 ± 0.104 | 10.815 | 11.141 | 4.51 ± 0.05 |
cairo-native (embedded AOT) |
2.426 ± 0.014 | 2.412 | 2.447 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.513 ± 0.014 | 2.488 | 2.538 | 1.04 ± 0.01 |
Benchmark for program dict_snapshot
Open benchmarks
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
544.8 ± 7.6 | 536.1 | 560.1 | 1.00 |
cairo-native (embedded AOT) |
2252.3 ± 25.5 | 2217.7 | 2303.4 | 4.13 ± 0.07 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2375.8 ± 36.1 | 2337.9 | 2428.7 | 4.36 ± 0.09 |
Benchmark for program factorial_2M
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
4.826 ± 0.024 | 4.796 | 4.860 | 1.75 ± 0.03 |
cairo-native (embedded AOT) |
2.754 ± 0.039 | 2.674 | 2.826 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.794 ± 0.053 | 2.687 | 2.876 | 1.01 ± 0.02 |
Benchmark for program fib_2M
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
4.752 ± 0.022 | 4.724 | 4.781 | 2.07 ± 0.03 |
cairo-native (embedded AOT) |
2.295 ± 0.031 | 2.228 | 2.339 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.322 ± 0.043 | 2.252 | 2.396 | 1.01 ± 0.02 |
Benchmark for program heavy_output_circuit
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
36.766 ± 0.451 | 36.012 | 37.524 | 1.00 |
cairo-native (embedded AOT) |
51.694 ± 0.583 | 50.911 | 52.595 | 1.41 ± 0.02 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
50.422 ± 0.315 | 49.925 | 50.906 | 1.37 ± 0.02 |
Benchmark for program linear_search
Open benchmarks
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
577.6 ± 16.3 | 561.1 | 603.3 | 1.00 |
cairo-native (embedded AOT) |
2316.9 ± 41.3 | 2240.6 | 2411.5 | 4.01 ± 0.13 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2461.6 ± 25.6 | 2429.7 | 2504.7 | 4.26 ± 0.13 |
Benchmark for program logistic_map
Open benchmarks
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
407.7 ± 5.8 | 399.5 | 415.1 | 1.00 |
cairo-native (embedded AOT) |
2505.1 ± 23.2 | 2465.0 | 2538.3 | 6.14 ± 0.10 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2676.7 ± 53.0 | 2570.9 | 2727.5 | 6.57 ± 0.16 |
✅ Code is now correctly formatted. |
cda88ba
to
aa46b9a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1419 +/- ##
==========================================
+ Coverage 81.38% 81.41% +0.03%
==========================================
Files 105 105
Lines 25805 25846 +41
==========================================
+ Hits 21001 21043 +42
+ Misses 4804 4803 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
91188f9
to
7ba95ec
Compare
348e424
to
5dadf39
Compare
0cc685a
to
ac9f14e
Compare
If we see no performance improvement with this PR, I don't think we should merge for know it as it makes the code more complicated. Also, not seeing a performance increase might mean that there is something wrong with the implementation but we just don't know it yet. |
I agree. I'll put it back to draft until we are sure what to do. |
Add reference counting to circuit_outputs dynamic array.
Closes #1234
We currently duplicate the circuit_outputs array for every time the get_output libfunc gets called. This is because this libfunc consumes the array. To avoid having to duplicate it, this PRs implements a reference counter to the circuit outputs array. This way, we don't need to duplicate anything, and the array will get freed only when the last reference gets dropped.
Benchmarks:
Programs
Programs were executed with release mode and optimization level 2 (in x86):
Transactions
Introduces Breaking Changes?
No.
starknet-blocks.yml
workflow to use these PRs.These PRs should be merged after this one right away, in that order.
Checklist