cairo_native
cairo_native copied to clipboard
More passes, better function attributes
With these function attributes the dead code elimination can remove a lot of useless functions that aren't called after the inline pass has done its job.
Checklist
- [ ] Linked to Github Issue
- [ ] Unit tests added
- [ ] Integration tests added.
- [ ] This change requires new documentation.
- [ ] Documentation has been added/updated.
Benchmark results Main vs HEAD.
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
head factorial_2M.cairo (JIT) |
3.262 ± 0.057 | 3.187 | 3.345 | 1.01 ± 0.02 |
base factorial_2M.cairo (JIT) |
3.291 ± 0.045 | 3.247 | 3.369 | 1.02 ± 0.02 |
head factorial_2M.cairo (AOT) |
3.218 ± 0.033 | 3.158 | 3.263 | 1.00 |
base factorial_2M.cairo (AOT) |
3.231 ± 0.028 | 3.189 | 3.288 | 1.00 ± 0.01 |
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
head fib_2M.cairo (JIT) |
2.736 ± 0.017 | 2.705 | 2.764 | 1.00 ± 0.01 |
base fib_2M.cairo (JIT) |
2.790 ± 0.032 | 2.724 | 2.855 | 1.02 ± 0.02 |
head fib_2M.cairo (AOT) |
2.726 ± 0.031 | 2.690 | 2.780 | 1.00 |
base fib_2M.cairo (AOT) |
2.746 ± 0.032 | 2.718 | 2.831 | 1.01 ± 0.02 |
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
head logistic_map.cairo (JIT) |
3.158 ± 0.046 | 3.091 | 3.234 | 1.04 ± 0.02 |
base logistic_map.cairo (JIT) |
3.359 ± 0.031 | 3.304 | 3.422 | 1.10 ± 0.01 |
head logistic_map.cairo (AOT) |
3.051 ± 0.031 | 2.996 | 3.087 | 1.00 |
base logistic_map.cairo (AOT) |
3.196 ± 0.020 | 3.166 | 3.230 | 1.05 ± 0.01 |
Codecov Report
Attention: Patch coverage is 95.59471% with 10 lines in your changes missing coverage. Please review.
Project coverage is 82.75%. Comparing base (
84ceaa3) to head (1246619).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/metadata/runtime_bindings.rs | 93.33% | 10 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #843 +/- ##
==========================================
+ Coverage 82.69% 82.75% +0.05%
==========================================
Files 120 120
Lines 34756 34901 +145
==========================================
+ Hits 28743 28882 +139
- Misses 6013 6019 +6
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Benchmarking results
Benchmark for program factorial_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
10.977 ± 0.331 | 10.580 | 11.395 | 23.33 ± 0.70 |
cairo-native (embedded AOT) |
3.290 ± 0.036 | 3.235 | 3.375 | 6.99 ± 0.08 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
3.322 ± 0.043 | 3.277 | 3.423 | 7.06 ± 0.09 |
cairo-native (standalone AOT) |
0.682 ± 0.005 | 0.678 | 0.691 | 1.45 ± 0.01 |
cairo-native (standalone AOT with -march=native) |
0.471 ± 0.001 | 0.470 | 0.472 | 1.00 |
Benchmark for program fib_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
11.040 ± 0.305 | 10.637 | 11.382 | 1364.35 ± 40.00 |
cairo-native (embedded AOT) |
2.804 ± 0.027 | 2.768 | 2.844 | 346.48 ± 4.74 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.871 ± 0.056 | 2.763 | 2.951 | 354.84 ± 7.73 |
cairo-native (standalone AOT) |
0.009 ± 0.000 | 0.009 | 0.009 | 1.08 ± 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) |
4.449 ± 0.042 | 4.368 | 4.493 | 61.57 ± 0.59 |
cairo-native (embedded AOT) |
2.978 ± 0.032 | 2.941 | 3.048 | 41.21 ± 0.45 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
3.027 ± 0.039 | 2.988 | 3.118 | 41.89 ± 0.55 |
cairo-native (standalone AOT) |
0.112 ± 0.000 | 0.112 | 0.114 | 1.55 ± 0.01 |
cairo-native (standalone AOT with -march=native) |
0.072 ± 0.000 | 0.072 | 0.073 | 1.00 |
Testing a bit with replay, but it seems to work fine.
The tx that failed https://starkscan.co/tx/0x00b2867a82804fcf3c9f99c11f58ee417f03e1524f44a3a5693f4fc293005761 with the opt level >1 doesn't appear to fail now with this change either.