added const support for EcPoint type#1588
Conversation
16f87d1 to
d199605
Compare
Benchmarking resultsBenchmark for program
|
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
11.532 ± 0.032 | 11.498 | 11.581 | 5.53 ± 0.08 |
cairo-native (embedded AOT) |
2.084 ± 0.028 | 2.051 | 2.122 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.150 ± 0.023 | 2.122 | 2.201 | 1.03 ± 0.02 |
Benchmark for program dict_snapshot
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
565.6 ± 13.3 | 551.4 | 587.4 | 1.00 |
cairo-native (embedded AOT) |
1787.3 ± 22.0 | 1751.2 | 1816.2 | 3.16 ± 0.08 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1873.2 ± 24.2 | 1838.8 | 1917.8 | 3.31 ± 0.09 |
Benchmark for program factorial_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
4.986 ± 0.042 | 4.947 | 5.095 | 2.24 ± 0.05 |
cairo-native (embedded AOT) |
2.223 ± 0.044 | 2.156 | 2.290 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.278 ± 0.054 | 2.213 | 2.372 | 1.02 ± 0.03 |
Benchmark for program fib_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
4.881 ± 0.026 | 4.855 | 4.942 | 2.81 ± 0.03 |
cairo-native (embedded AOT) |
1.739 ± 0.015 | 1.708 | 1.760 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1.810 ± 0.029 | 1.764 | 1.845 | 1.04 ± 0.02 |
Benchmark for program linear_search
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
603.3 ± 16.6 | 588.9 | 648.1 | 1.00 |
cairo-native (embedded AOT) |
1776.9 ± 30.8 | 1729.4 | 1815.3 | 2.95 ± 0.10 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1906.7 ± 33.4 | 1880.6 | 1977.9 | 3.16 ± 0.10 |
Benchmark for program logistic_map
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
515.6 ± 9.0 | 498.5 | 531.6 | 1.00 |
cairo-native (embedded AOT) |
1919.1 ± 26.4 | 1889.8 | 1964.0 | 3.72 ± 0.08 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2082.0 ± 12.7 | 2059.6 | 2099.6 | 4.04 ± 0.07 |
orizi
left a comment
There was a problem hiding this comment.
@orizi made 1 comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on TomerStarkware).
a discussion (no related file):
fix PR description.
Benchmark results Main vs HEAD.Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
|
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on TomerStarkware).
src/libfuncs/const.rs line 297 at r1 (raw file):
_ => val, }; entry.const_int(context, location, val, 252)?
this feels like something that happens a lot of times in this project.
Code quote:
let (sign, val) = x.clone().into_parts();
let val = match sign {
Sign::Minus => PRIME.clone() - val,
_ => val,
};
entry.const_int(context, location, val, 252)?d199605 to
c1e64c1
Compare
TomerStarkware
left a comment
There was a problem hiding this comment.
@TomerStarkware made 2 comments.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on orizi).
a discussion (no related file):
Previously, orizi wrote…
fix PR description.
Done.
src/libfuncs/const.rs line 297 at r1 (raw file):
Previously, orizi wrote…
this feels like something that happens a lot of times in this project.
Done.
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 4 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on TomerStarkware).
src/utils.rs line 244 at r2 (raw file):
pub fn felt252_str(value: &str) -> Felt { let value = value
Suggestion:
}
/// Normalize a signed BigInt felt value to its unsigned field representation.
///
/// Negative values are mapped to `PRIME - |value|`.
pub fn felt_to_unsigned(value: &BigInt) -> BigUint {
match value.sign() {
Sign::Minus => &*PRIME - value.magnitude(),
_ => value.magnitude().clone(),
}
}
/// Parse a numeric string into felt, wrapping negatives around the prime modulo.
pub fn felt252_str(value: &str) -> Felt {
let value = valuec1e64c1 to
cb9bcfb
Compare
TomerStarkware
left a comment
There was a problem hiding this comment.
@TomerStarkware made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on orizi).
src/utils.rs line 244 at r2 (raw file):
pub fn felt252_str(value: &str) -> Felt { let value = value
Done.
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 1 file and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on TomerStarkware).
added const support for EcPoint type
added const support for EcPoint type
Introduces Breaking Changes?
No
This change is