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

Replace security anyhow errors with enum variants #1946

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JulianGCalderon
Copy link
Contributor

Replace some anyhow errors with enum variants

Description

This PR replace some anyhow errors with new enum variants

Checklist

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

@JulianGCalderon JulianGCalderon changed the title Replace some anyhow errors with enum variants Replace security anyhow errors with enum variants Feb 11, 2025
Copy link

github-actions bot commented Feb 11, 2025

**Hyper Thereading Benchmark results**




hyperfine -r 2 -n "hyper_threading_main threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_main' -n "hyper_threading_pr threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 1
  Time (mean ± σ):     27.500 s ±  0.047 s    [User: 26.734 s, System: 0.765 s]
  Range (min … max):   27.467 s … 27.534 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     27.616 s ±  0.154 s    [User: 26.840 s, System: 0.773 s]
  Range (min … max):   27.507 s … 27.725 s    2 runs
 
Summary
  hyper_threading_main threads: 1 ran
    1.00 ± 0.01 times faster than hyper_threading_pr threads: 1




hyperfine -r 2 -n "hyper_threading_main threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_main' -n "hyper_threading_pr threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 2
  Time (mean ± σ):     15.418 s ±  0.211 s    [User: 26.928 s, System: 0.801 s]
  Range (min … max):   15.269 s … 15.568 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     15.304 s ±  0.043 s    [User: 26.934 s, System: 0.796 s]
  Range (min … max):   15.274 s … 15.334 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.01 ± 0.01 times faster than hyper_threading_main threads: 2




hyperfine -r 2 -n "hyper_threading_main threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_main' -n "hyper_threading_pr threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 4
  Time (mean ± σ):     11.324 s ±  0.568 s    [User: 41.138 s, System: 0.957 s]
  Range (min … max):   10.923 s … 11.726 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     11.169 s ±  0.102 s    [User: 40.280 s, System: 0.951 s]
  Range (min … max):   11.097 s … 11.241 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.01 ± 0.05 times faster than hyper_threading_main threads: 4




hyperfine -r 2 -n "hyper_threading_main threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_main' -n "hyper_threading_pr threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 6
  Time (mean ± σ):     11.049 s ±  0.142 s    [User: 41.335 s, System: 0.983 s]
  Range (min … max):   10.948 s … 11.149 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     11.149 s ±  0.011 s    [User: 40.295 s, System: 0.944 s]
  Range (min … max):   11.142 s … 11.157 s    2 runs
 
Summary
  hyper_threading_main threads: 6 ran
    1.01 ± 0.01 times faster than hyper_threading_pr threads: 6




hyperfine -r 2 -n "hyper_threading_main threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_main' -n "hyper_threading_pr threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 8
  Time (mean ± σ):     11.321 s ±  0.068 s    [User: 41.326 s, System: 0.967 s]
  Range (min … max):   11.273 s … 11.369 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     11.042 s ±  0.130 s    [User: 40.599 s, System: 0.982 s]
  Range (min … max):   10.950 s … 11.134 s    2 runs
 
Summary
  hyper_threading_pr threads: 8 ran
    1.03 ± 0.01 times faster than hyper_threading_main threads: 8




hyperfine -r 2 -n "hyper_threading_main threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_main' -n "hyper_threading_pr threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 16
  Time (mean ± σ):     11.141 s ±  0.226 s    [User: 41.694 s, System: 1.092 s]
  Range (min … max):   10.980 s … 11.301 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.896 s ±  0.010 s    [User: 41.299 s, System: 1.115 s]
  Range (min … max):   10.889 s … 10.903 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.02 ± 0.02 times faster than hyper_threading_main threads: 16


Copy link

github-actions bot commented Feb 11, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.233 ± 0.036 2.203 2.332 1.01 ± 0.02
head big_factorial 2.208 ± 0.036 2.175 2.303 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.168 ± 0.007 2.160 2.183 1.01 ± 0.01
head big_fibonacci 2.139 ± 0.023 2.114 2.190 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.249 ± 0.176 8.150 8.745 1.00 ± 0.03
head blake2s_integration_benchmark 8.246 ± 0.184 8.032 8.545 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.305 ± 0.042 2.270 2.413 1.01 ± 0.02
head compare_arrays_200000 2.292 ± 0.032 2.250 2.348 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.477 ± 0.006 1.466 1.485 1.00
head dict_integration_benchmark 1.491 ± 0.009 1.476 1.513 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.282 ± 0.003 1.279 1.286 1.00
head field_arithmetic_get_square_benchmark 1.295 ± 0.008 1.290 1.314 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.225 ± 0.031 8.175 8.276 1.00
head integration_builtins 8.374 ± 0.162 8.092 8.582 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.498 ± 0.058 8.451 8.654 1.00
head keccak_integration_benchmark 8.530 ± 0.195 8.326 8.802 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.261 ± 0.006 2.254 2.268 1.00
head linear_search 2.267 ± 0.057 2.227 2.423 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.579 ± 0.023 1.565 1.644 1.01 ± 0.02
head math_cmp_and_pow_integration_benchmark 1.563 ± 0.007 1.551 1.572 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.527 ± 0.014 1.512 1.559 1.01 ± 0.01
head math_integration_benchmark 1.517 ± 0.006 1.509 1.528 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.254 ± 0.007 1.245 1.266 1.00
head memory_integration_benchmark 1.260 ± 0.004 1.253 1.268 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.626 ± 0.006 1.617 1.636 1.00
head operations_with_data_structures_benchmarks 1.640 ± 0.009 1.623 1.657 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 547.4 ± 1.3 545.9 550.1 1.00 ± 0.00
head pedersen 544.9 ± 2.4 541.3 548.5 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 647.7 ± 5.8 639.5 656.2 1.00
head poseidon_integration_benchmark 662.5 ± 5.7 654.8 670.4 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.898 ± 0.007 1.891 1.913 1.00
head secp_integration_benchmark 1.904 ± 0.012 1.885 1.918 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 673.1 ± 4.3 668.6 683.4 1.00
head set_integration_benchmark 703.2 ± 10.4 689.4 714.4 1.04 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.513 ± 0.016 4.485 4.537 1.00
head uint256_integration_benchmark 4.555 ± 0.127 4.420 4.893 1.01 ± 0.03

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.35%. Comparing base (a24c1b8) to head (afaf0e3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1946      +/-   ##
==========================================
- Coverage   96.37%   96.35%   -0.02%     
==========================================
  Files         102      102              
  Lines       41245    41227      -18     
==========================================
- Hits        39749    39726      -23     
- Misses       1496     1501       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JulianGCalderon JulianGCalderon force-pushed the remove-some-anyhow-errors branch from 029d790 to afaf0e3 Compare February 12, 2025 19:37
@JulianGCalderon JulianGCalderon marked this pull request as ready for review February 12, 2025 19: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.

1 participant