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

Thv/faster compilation #326

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Thv/faster compilation #326

merged 2 commits into from
Sep 19, 2024

Commits on Sep 19, 2024

  1. build: Set opt-level=3 on build script execution

    The degree-lowering step takes up 90-95 % of the total build time. The
    degree-lowering code is executed in the build script `build.rs`. By
    default, Cargo compiles build scripts in debug mode with optimization
    level 0. Overriding this default leads to a 6-times speedup in the
    compilation time on my machine (mjolnir), as the build script execution
    goes from taking ~150s to ~25s. Running from a clean slate (using
    `cargo clean`), this change results in a speedup from 2m 29s to 52.2s.
    Sword-Smith committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    5e16b08 View commit details
    Browse the repository at this point in the history
  2. perf(degree_lowering): cache node-degrees

    Cache node degrees in the `pick_node_to_substitute` function which was
    found to be the bottle-neck in the build script. This caching shaves off
    38 % of the time it takes to degree-lower, and 30 % of total build time
    of Triton VM.
    
    Measurements on my machine (mjolnir):
    degree-lowering step in build script:
    Before caching degrees:
    - 22.024172299s
    - 21.938811734s
    
    After caching:
    - 13.657397858s
    - 13.753980057s
    
    Total time to build triton-vm after change to
    `triton-constraint-circuit/src/lib.rs`:
    Before caching degrees:
    - 26.13s
    - 26.74s
    
    After caching:
    - 18.63s
    - 18.65s
    Sword-Smith committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    6496a74 View commit details
    Browse the repository at this point in the history