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

perf: replace asserts by debug_asserts #516

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

Oppen
Copy link
Member

@Oppen Oppen commented Jul 27, 2023

Runtime assertions to validate inputs were consuming a significant
amount of time in benchmarks.

Measured on an M1, based on branch fix_felt_benchmarks with the
ark-ff code commented out to reduce noise we observe the following
changes:

add | lambdaworks       time:   [12.273 µs 12.278 µs 12.285 µs]
                        change: [-63.107% -63.042% -62.979%] (p = 0.00 < 0.05)
                        Performance has improved.
invert | lambdaworks    time:   [26.858 ms 26.864 ms 26.871 ms]
                        change: [-7.8986% -7.8611% -7.8231%] (p = 0.00 < 0.05)
                        Performance has improved.
mul | lambdaworks       time:   [63.604 µs 63.622 µs 63.645 µs]
                        change: [-0.1615% -0.0957% -0.0332%] (p = 0.00 < 0.05)
                        Change within noise threshold.
pow | lambdaworks       time:   [12.594 ms 12.599 ms 12.604 ms]
                        change: [-0.4536% -0.4009% -0.3481%] (p = 0.00 < 0.05)
                        Change within noise threshold.
sqrt | lambdaworks      time:   [139.76 ms 139.79 ms 139.82 ms]
                        change: [-0.1288% -0.1015% -0.0730%] (p = 0.00 < 0.05)
                        Change within noise threshold.
sub | lambdaworks       time:   [13.518 µs 13.529 µs 13.542 µs]
                        change: [-19.474% -18.102% -17.059%] (p = 0.00 < 0.05)
                        Performance has improved.

Type of change

  • Optimization

Checklist

  • This change is an Optimization
    • Benchmarks added/run

Runtime assertions to validate inputs were consuming a significant
amount of time in benchmarks.

Measured on an M1, based on branch `fix_felt_benchmarks` with the
`ark-ff` code commented out to reduce noise we observe the following
changes:

```
add | lambdaworks       time:   [12.273 µs 12.278 µs 12.285 µs]
                        change: [-63.107% -63.042% -62.979%] (p = 0.00 < 0.05)
                        Performance has improved.
invert | lambdaworks    time:   [26.858 ms 26.864 ms 26.871 ms]
                        change: [-7.8986% -7.8611% -7.8231%] (p = 0.00 < 0.05)
                        Performance has improved.
mul | lambdaworks       time:   [63.604 µs 63.622 µs 63.645 µs]
                        change: [-0.1615% -0.0957% -0.0332%] (p = 0.00 < 0.05)
                        Change within noise threshold.
pow | lambdaworks       time:   [12.594 ms 12.599 ms 12.604 ms]
                        change: [-0.4536% -0.4009% -0.3481%] (p = 0.00 < 0.05)
                        Change within noise threshold.
sqrt | lambdaworks      time:   [139.76 ms 139.79 ms 139.82 ms]
                        change: [-0.1288% -0.1015% -0.0730%] (p = 0.00 < 0.05)
                        Change within noise threshold.
sub | lambdaworks       time:   [13.518 µs 13.529 µs 13.542 µs]
                        change: [-19.474% -18.102% -17.059%] (p = 0.00 < 0.05)
                        Performance has improved.
```
@Oppen Oppen requested review from a team, schouhy and ajgara as code owners July 27, 2023 20:38
@MauroToscano MauroToscano added this pull request to the merge queue Jul 31, 2023
Merged via the queue into main with commit 81d8311 Jul 31, 2023
7 checks passed
@MauroToscano MauroToscano deleted the perf/debug_asserts_for_sub_and_div_rem branch July 31, 2023 12:37
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.

4 participants