Skip to content

Conversation

DiegoCivi
Copy link
Contributor

@DiegoCivi DiegoCivi commented May 30, 2025

Remove unused dependencies

Description

cargo-udeps and cargo-machete were used to check which were the unused dependencies. The following were removed:

  • main cargo project (./Cargo.toml):
    • cairo-lang-starknet
  • vm (./vm/Cargo.toml):
    • cairo-lang-starknet
    • hex
  • cairo-vm-tracer (./cairo-vm-tracer/Cargo.toml):
    • tower
  • cairo1-run (./cairo1-run/Cargo.toml):
    • cairo-lang-sierra-ap-change
    • cairo-lang-sierra-gas
    • cairo-lang-starknet-classes
    • mimalloc
  • wasm-demo (./examples/wasm-demo/Cargo.toml):
    • serde_json
    • wasm-bindgen-test
  • cairo-vm-cli (./cairo-vm-cli/Cargo.toml):
    • nom

Fixes #2109

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.

@DiegoCivi DiegoCivi added the nochangelog Skip the changelog check label May 30, 2025
[features]
default = ["with_mimalloc"]
with_mimalloc = ["dep:mimalloc"]
with_mimalloc = []
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this feature necessary? As far as I understand, it is not being used in cairo1-run

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, I think it's not used and it would be safe to remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! f50aaa3

Copy link

github-actions bot commented May 30, 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 ± σ):     25.604 s ±  0.055 s    [User: 24.841 s, System: 0.760 s]
  Range (min … max):   25.565 s … 25.643 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     25.549 s ±  0.054 s    [User: 24.787 s, System: 0.759 s]
  Range (min … max):   25.510 s … 25.587 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.348 s ±  0.039 s    [User: 24.991 s, System: 0.811 s]
  Range (min … max):   14.321 s … 14.376 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.305 s ±  0.002 s    [User: 24.956 s, System: 0.776 s]
  Range (min … max):   14.303 s … 14.306 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.654 s ±  0.156 s    [User: 37.334 s, System: 0.966 s]
  Range (min … max):   10.543 s … 10.764 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.278 s ±  0.215 s    [User: 37.734 s, System: 0.936 s]
  Range (min … max):   10.126 s … 10.430 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.04 ± 0.03 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 ± σ):     10.443 s ±  0.267 s    [User: 37.398 s, System: 0.970 s]
  Range (min … max):   10.254 s … 10.632 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.765 s ±  0.003 s    [User: 37.639 s, System: 1.003 s]
  Range (min … max):   10.763 s … 10.767 s    2 runs
 
Summary
  hyper_threading_main threads: 6 ran
    1.03 ± 0.03 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.252 s ±  0.087 s    [User: 38.013 s, System: 0.983 s]
  Range (min … max):   10.190 s … 10.314 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.345 s ±  0.004 s    [User: 38.081 s, System: 1.027 s]
  Range (min … max):   10.342 s … 10.348 s    2 runs
 
Summary
  hyper_threading_main threads: 8 ran
    1.01 ± 0.01 times faster than hyper_threading_pr 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.253 s ±  0.232 s    [User: 38.294 s, System: 1.064 s]
  Range (min … max):   10.089 s … 10.417 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.214 s ±  0.073 s    [User: 38.671 s, System: 1.107 s]
  Range (min … max):   10.162 s … 10.266 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.00 ± 0.02 times faster than hyper_threading_main threads: 16


Copy link

github-actions bot commented May 30, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.135 ± 0.015 2.117 2.159 1.00 ± 0.01
head big_factorial 2.132 ± 0.013 2.115 2.150 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.073 ± 0.019 2.048 2.108 1.00 ± 0.01
head big_fibonacci 2.071 ± 0.017 2.058 2.115 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.862 ± 0.048 7.788 7.936 1.00 ± 0.01
head blake2s_integration_benchmark 7.849 ± 0.041 7.803 7.915 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.193 ± 0.011 2.178 2.215 1.00
head compare_arrays_200000 2.201 ± 0.009 2.190 2.219 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.449 ± 0.010 1.438 1.468 1.00
head dict_integration_benchmark 1.463 ± 0.017 1.444 1.495 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.245 ± 0.015 1.230 1.282 1.00 ± 0.01
head field_arithmetic_get_square_benchmark 1.245 ± 0.011 1.236 1.273 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.006 ± 0.115 7.930 8.319 1.00
head integration_builtins 8.021 ± 0.059 7.944 8.134 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.221 ± 0.043 8.173 8.291 1.00 ± 0.01
head keccak_integration_benchmark 8.219 ± 0.099 8.114 8.432 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.177 ± 0.009 2.160 2.193 1.00
head linear_search 2.182 ± 0.019 2.165 2.214 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.500 ± 0.017 1.489 1.543 1.00 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.499 ± 0.004 1.491 1.503 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.456 ± 0.017 1.442 1.488 1.00 ± 0.01
head math_integration_benchmark 1.455 ± 0.011 1.445 1.479 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.217 ± 0.014 1.202 1.254 1.01 ± 0.01
head memory_integration_benchmark 1.210 ± 0.006 1.202 1.223 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.569 ± 0.013 1.555 1.597 1.00
head operations_with_data_structures_benchmarks 1.575 ± 0.004 1.568 1.584 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 530.0 ± 1.5 527.9 532.8 1.00
head pedersen 531.6 ± 5.0 527.4 544.5 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 621.1 ± 6.0 611.6 633.3 1.00
head poseidon_integration_benchmark 622.9 ± 5.2 614.0 629.8 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.833 ± 0.024 1.814 1.896 1.01 ± 0.02
head secp_integration_benchmark 1.822 ± 0.014 1.808 1.855 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 627.1 ± 1.4 625.5 630.3 1.00
head set_integration_benchmark 673.7 ± 24.8 655.5 728.6 1.07 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.325 ± 0.026 4.287 4.374 1.01 ± 0.01
head uint256_integration_benchmark 4.301 ± 0.025 4.275 4.356 1.00

Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.67%. Comparing base (4f02f5a) to head (34135dd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2111   +/-   ##
=======================================
  Coverage   96.67%   96.67%           
=======================================
  Files         103      103           
  Lines       43597    43597           
=======================================
  Hits        42147    42147           
  Misses       1450     1450           

☔ 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.

@gabrielbosio
Copy link
Collaborator

I would remove the nochangelog label in this PR and add the corresponding line in the changelog file

@DiegoCivi DiegoCivi removed the nochangelog Skip the changelog check label Jun 2, 2025
@DiegoCivi DiegoCivi marked this pull request as ready for review June 2, 2025 20:45
Copy link
Contributor

@JulianGCalderon JulianGCalderon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gabrielbosio gabrielbosio added this pull request to the merge queue Jun 4, 2025
Merged via the queue into main with commit 7c1b9d9 Jun 4, 2025
93 checks passed
@gabrielbosio gabrielbosio deleted the chore/remove-unused-dependencies branch June 4, 2025 21:11
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.

Check for unused dependencies

3 participants