Skip to content

deps: use uv if present #1754

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

deps: use uv if present #1754

wants to merge 8 commits into from

Conversation

Oppen
Copy link
Contributor

@Oppen Oppen commented May 8, 2024

uv is a compatible pip replacement made in Rust, which runs
significantly faster. It saves about 70 seconds on my M3 when installing
deps.

TITLE

Description

Description of the pull request changes and motivation.

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.

@Oppen Oppen added the pipelines This PR/issue is exclusively about improving our CI label May 8, 2024
`uv` is a compatible `pip` replacement made in Rust, which runs
significantly faster. It saves about 70 seconds on my M3 when installing
deps.
@Oppen Oppen force-pushed the ci/optional_uv branch from cc8133c to f4f1612 Compare May 8, 2024 19:50
Copy link

github-actions bot commented May 8, 2024

**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 ± σ):     26.301 s ±  0.003 s    [User: 25.558 s, System: 0.742 s]
  Range (min … max):   26.299 s … 26.303 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     26.285 s ±  0.026 s    [User: 25.542 s, System: 0.742 s]
  Range (min … max):   26.266 s … 26.303 s    2 runs
 
Summary
  hyper_threading_pr threads: 1 ran
    1.00 ± 0.00 times faster than hyper_threading_main 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 ± σ):     14.650 s ±  0.023 s    [User: 25.710 s, System: 0.780 s]
  Range (min … max):   14.633 s … 14.666 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.637 s ±  0.009 s    [User: 25.653 s, System: 0.799 s]
  Range (min … max):   14.631 s … 14.643 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.00 ± 0.00 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 ± σ):     10.492 s ±  0.564 s    [User: 38.066 s, System: 0.962 s]
  Range (min … max):   10.093 s … 10.890 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.638 s ±  0.388 s    [User: 37.659 s, System: 0.974 s]
  Range (min … max):   10.364 s … 10.912 s    2 runs
 
Summary
  hyper_threading_main threads: 4 ran
    1.01 ± 0.07 times faster than hyper_threading_pr 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 ± σ):     10.396 s ±  0.372 s    [User: 37.990 s, System: 0.953 s]
  Range (min … max):   10.133 s … 10.659 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.401 s ±  0.167 s    [User: 38.181 s, System: 0.935 s]
  Range (min … max):   10.282 s … 10.519 s    2 runs
 
Summary
  hyper_threading_main threads: 6 ran
    1.00 ± 0.04 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 ± σ):     10.350 s ±  0.096 s    [User: 38.172 s, System: 0.969 s]
  Range (min … max):   10.282 s … 10.418 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.211 s ±  0.007 s    [User: 38.427 s, System: 0.961 s]
  Range (min … max):   10.207 s … 10.216 s    2 runs
 
Summary
  hyper_threading_pr threads: 8 ran
    1.01 ± 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 ± σ):     10.359 s ±  0.250 s    [User: 38.647 s, System: 1.079 s]
  Range (min … max):   10.182 s … 10.536 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.247 s ±  0.009 s    [User: 38.816 s, System: 1.073 s]
  Range (min … max):   10.240 s … 10.253 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.01 ± 0.02 times faster than hyper_threading_main threads: 16


@Oppen Oppen force-pushed the ci/optional_uv branch from 800221c to b25d2bc Compare May 8, 2024 20:10
Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.55%. Comparing base (0038711) to head (10bc8d4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1754   +/-   ##
=======================================
  Coverage   96.55%   96.55%           
=======================================
  Files         102      102           
  Lines       42872    42872           
=======================================
  Hits        41394    41394           
  Misses       1478     1478           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

github-actions bot commented May 8, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.119 ± 0.024 2.104 2.184 1.01 ± 0.01
head big_factorial 2.109 ± 0.003 2.104 2.114 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.044 ± 0.017 2.032 2.090 1.00 ± 0.01
head big_fibonacci 2.039 ± 0.016 2.025 2.079 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.546 ± 0.090 7.461 7.759 1.01 ± 0.01
head blake2s_integration_benchmark 7.464 ± 0.062 7.406 7.606 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.181 ± 0.033 2.145 2.249 1.01 ± 0.02
head compare_arrays_200000 2.170 ± 0.013 2.156 2.198 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.443 ± 0.003 1.439 1.448 1.00
head dict_integration_benchmark 1.444 ± 0.008 1.437 1.463 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.218 ± 0.015 1.204 1.256 1.01 ± 0.02
head field_arithmetic_get_square_benchmark 1.209 ± 0.015 1.199 1.248 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.577 ± 0.042 7.514 7.659 1.01 ± 0.01
head integration_builtins 7.514 ± 0.029 7.467 7.559 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.875 ± 0.102 7.801 8.156 1.00 ± 0.02
head keccak_integration_benchmark 7.855 ± 0.099 7.748 8.052 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.153 ± 0.009 2.146 2.172 1.00 ± 0.01
head linear_search 2.150 ± 0.019 2.132 2.195 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.523 ± 0.005 1.515 1.529 1.00 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.523 ± 0.014 1.510 1.559 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.477 ± 0.010 1.463 1.503 1.01 ± 0.01
head math_integration_benchmark 1.466 ± 0.015 1.459 1.507 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.213 ± 0.001 1.211 1.214 1.00
head memory_integration_benchmark 1.218 ± 0.017 1.207 1.266 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.587 ± 0.010 1.577 1.615 1.01 ± 0.01
head operations_with_data_structures_benchmarks 1.572 ± 0.012 1.562 1.603 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 532.8 ± 1.2 530.7 534.5 1.00
head pedersen 534.3 ± 3.8 530.6 541.0 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 630.0 ± 3.8 620.6 634.5 1.00 ± 0.01
head poseidon_integration_benchmark 630.0 ± 4.3 620.2 635.5 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.861 ± 0.011 1.850 1.891 1.01 ± 0.01
head secp_integration_benchmark 1.851 ± 0.005 1.842 1.860 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 662.2 ± 4.3 655.0 666.7 1.01 ± 0.01
head set_integration_benchmark 656.7 ± 4.5 652.4 665.7 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.210 ± 0.032 4.169 4.261 1.01 ± 0.01
head uint256_integration_benchmark 4.184 ± 0.023 4.136 4.210 1.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pipelines This PR/issue is exclusively about improving our CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants