Skip to content

Conversation

JulianGCalderon
Copy link
Contributor

@JulianGCalderon JulianGCalderon commented Feb 26, 2025

Some functions that could panic were only used in tests, but were available to the whole project. This PR moves the functions to ensure that they are only used in tests.

Update: it seem that files in the tests directory cannot access functions inside of a test module.

Checklist

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

Copy link

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 3.966 ± 0.073 3.879 4.136 1.00
base dict_insert.cairo (AOT) 4.044 ± 0.055 3.930 4.132 1.02 ± 0.02

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 3.850 ± 0.042 3.802 3.926 1.00 ± 0.01
head dict_insert.cairo (AOT) 3.832 ± 0.031 3.777 3.872 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 3.952 ± 0.049 3.888 4.027 1.04 ± 0.02
base dict_snapshot.cairo (AOT) 3.785 ± 0.046 3.712 3.875 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 3.753 ± 0.016 3.728 3.777 1.03 ± 0.01
head dict_snapshot.cairo (AOT) 3.658 ± 0.034 3.605 3.724 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 4.237 ± 0.049 4.159 4.305 1.02 ± 0.01
base factorial_2M.cairo (AOT) 4.174 ± 0.032 4.103 4.219 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 4.065 ± 0.020 4.034 4.100 1.01 ± 0.01
head factorial_2M.cairo (AOT) 4.030 ± 0.019 3.988 4.052 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 3.807 ± 0.052 3.718 3.891 1.03 ± 0.02
base fib_2M.cairo (AOT) 3.709 ± 0.045 3.648 3.770 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 3.613 ± 0.015 3.594 3.635 1.01 ± 0.01
head fib_2M.cairo (AOT) 3.567 ± 0.031 3.537 3.644 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 4.013 ± 0.056 3.944 4.114 1.05 ± 0.02
base linear_search.cairo (AOT) 3.837 ± 0.041 3.760 3.887 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 3.777 ± 0.015 3.752 3.802 1.03 ± 0.01
head linear_search.cairo (AOT) 3.674 ± 0.035 3.614 3.748 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 4.058 ± 0.052 3.951 4.128 1.06 ± 0.02
base logistic_map.cairo (AOT) 3.845 ± 0.038 3.791 3.919 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.920 ± 0.027 3.880 3.973 1.05 ± 0.01
head logistic_map.cairo (AOT) 3.730 ± 0.017 3.711 3.762 1.00

Copy link

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 20.523 ± 0.102 20.379 20.689 5.39 ± 0.04
cairo-native (embedded AOT) 3.804 ± 0.019 3.775 3.838 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.892 ± 0.017 3.859 3.915 1.02 ± 0.01

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.883 ± 0.067 5.770 5.979 1.61 ± 0.02
cairo-native (embedded AOT) 3.662 ± 0.022 3.630 3.690 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.758 ± 0.019 3.728 3.789 1.03 ± 0.01

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.217 ± 0.084 14.118 14.413 3.51 ± 0.03
cairo-native (embedded AOT) 4.054 ± 0.025 4.034 4.112 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.098 ± 0.019 4.075 4.133 1.01 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.103 ± 0.039 14.049 14.166 3.93 ± 0.02
cairo-native (embedded AOT) 3.593 ± 0.018 3.568 3.624 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.650 ± 0.028 3.614 3.705 1.02 ± 0.01

Benchmark for program linear_search

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.820 ± 0.031 5.767 5.867 1.57 ± 0.02
cairo-native (embedded AOT) 3.712 ± 0.032 3.673 3.780 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.838 ± 0.017 3.811 3.860 1.03 ± 0.01

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.743 ± 0.034 5.697 5.823 1.51 ± 0.02
cairo-native (embedded AOT) 3.795 ± 0.031 3.751 3.844 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.978 ± 0.022 3.937 4.015 1.05 ± 0.01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant