Skip to content

Conversation

@carneiro-cw
Copy link
Contributor

@carneiro-cw carneiro-cw commented Mar 26, 2025

PR Type

Enhancement


Description

  • Optimize release build performance with codegen-units=1

Changes walkthrough 📝

Relevant files
Performance optimization
Cargo.toml
Set codegen-units to 1 for release builds                               

Cargo.toml

  • Added codegen-units = 1 to the release profile
+1/-0     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @carneiro-cw
    Copy link
    Contributor Author

    /benchmark

    @github-actions
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    @github-actions
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Consider performance vs. build time

    Consider the trade-off between build time and runtime performance when setting
    codegen-units to 1. While this can potentially improve runtime performance, it may
    significantly increase compile times, especially for large projects. Evaluate if
    this trade-off is beneficial for your specific use case.

    Cargo.toml [247-249]

     [profile.release]
     lto = "fat"
    -codegen-units = 1
    +codegen-units = 1  # Optimizes for runtime performance, may increase build time
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion highlights an important trade-off between runtime performance and build time, which is valuable for optimizing the project. However, it doesn't address a critical issue, hence the moderate score.

    Low

    @codecov
    Copy link

    codecov bot commented Mar 26, 2025

    Codecov Report

    ✅ All modified and coverable lines are covered by tests.
    ✅ Project coverage is 81.58%. Comparing base (00d4b4f) to head (0bae3a9).
    ⚠️ Report is 3 commits behind head on main.

    Additional details and impacted files
    @@            Coverage Diff             @@
    ##             main    #2068      +/-   ##
    ==========================================
    + Coverage   79.87%   81.58%   +1.70%     
    ==========================================
      Files         131      131              
      Lines       10735    11088     +353     
    ==========================================
    + Hits         8575     9046     +471     
    + Misses       2160     2042     -118     
    Flag Coverage Δ
    contracts-rocks- 44.26% <ø> (-0.02%) ⬇️
    e2e-admin-password 22.60% <ø> (-0.05%) ⬇️
    e2e-clock-stratus 25.43% <ø> (-0.06%) ⬇️
    e2e-genesis 26.97% <ø> (-0.06%) ⬇️
    e2e-importer-offline 59.22% <ø> (?)
    e2e-rpc-downloader 54.28% <ø> (?)
    e2e-stratus 56.37% <ø> (+0.14%) ⬆️
    leader-follower- 62.51% <ø> (+0.07%) ⬆️
    rust-tests 28.73% <ø> (-0.83%) ⬇️

    Flags with carried forward coverage won't be shown. Click here to find out more.

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

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-2153238735

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2774.00, Min: 1542.00, Avg: 2498.11, StdDev: 107.39
    TPS Stats: Max: 2724.00, Min: 2136.00, Avg: 2425.74, StdDev: 119.42

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.28, StdDev: 0.45
    Imported Transactions/s: Max: 5427.00, Min: 969.00, Avg: 3196.78, StdDev: 1130.09

    Plots:

    @carneiro-cw
    Copy link
    Contributor Author

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-3041277549

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2499.00, Min: 1506.00, Avg: 2255.85, StdDev: 102.42
    TPS Stats: Max: 2504.00, Min: 2046.00, Avg: 2189.71, StdDev: 115.03

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.43, StdDev: 0.50
    Imported Transactions/s: Max: 4846.00, Min: 36.00, Avg: 3225.06, StdDev: 1127.00

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-960682212

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2648.00, Min: 1645.00, Avg: 2404.60, StdDev: 103.99
    TPS Stats: Max: 2653.00, Min: 1999.00, Avg: 2334.26, StdDev: 120.12

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.31, StdDev: 0.46
    Imported Transactions/s: Max: 5139.00, Min: 47.00, Avg: 3146.70, StdDev: 1132.99

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-2080975847

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2737.00, Min: 758.00, Avg: 2333.70, StdDev: 240.64
    TPS Stats: Max: 2747.00, Min: 555.00, Avg: 2263.77, StdDev: 260.30

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.21, StdDev: 0.41
    Imported Transactions/s: Max: 5451.00, Min: 8.00, Avg: 2757.12, StdDev: 1102.52

    Plots:

    @carneiro-cw
    Copy link
    Contributor Author

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-1068733589

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2776.00, Min: 1564.00, Avg: 2380.25, StdDev: 206.36
    TPS Stats: Max: 2757.00, Min: 1854.00, Avg: 2310.63, StdDev: 215.73

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.05, StdDev: 0.21
    Imported Transactions/s: Max: 4719.00, Min: 450.00, Avg: 2473.09, StdDev: 456.98

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    /flamegraph

    @gabriel-aranha-cw
    Copy link
    Contributor

    Flamegraphs:
    Run ID: bench-2233695219

    Git Info:

    Flamegraphs:
    idle:

    write:

    read:

    follower:

    @carneiro-cw
    Copy link
    Contributor Author

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-829228343

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2212.00, Min: 1260.00, Avg: 1967.76, StdDev: 133.30
    TPS Stats: Max: 2218.00, Min: 1339.00, Avg: 1910.35, StdDev: 139.31

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.64, StdDev: 0.48
    Imported Transactions/s: Max: 4348.00, Min: 1819.00, Avg: 3222.96, StdDev: 943.35

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    /benchmark

    2 similar comments
    @gabriel-aranha-cw
    Copy link
    Contributor

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-493824455

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2862.00, Min: 1677.00, Avg: 2657.90, StdDev: 109.19
    TPS Stats: Max: 2864.00, Min: 2255.00, Avg: 2580.77, StdDev: 124.61

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.21, StdDev: 0.41
    Imported Transactions/s: Max: 5572.00, Min: 1237.00, Avg: 3208.80, StdDev: 1075.92

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-1954284244

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2873.00, Min: 1715.00, Avg: 2646.15, StdDev: 125.15
    TPS Stats: Max: 2877.00, Min: 2264.00, Avg: 2569.16, StdDev: 137.71

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.21, StdDev: 0.41
    Imported Transactions/s: Max: 5738.00, Min: 2273.00, Avg: 3197.17, StdDev: 1063.85

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-441597755

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2945.00, Min: 1742.00, Avg: 2680.26, StdDev: 115.69
    TPS Stats: Max: 2953.00, Min: 2363.00, Avg: 2602.17, StdDev: 129.87

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.23, StdDev: 0.42
    Imported Transactions/s: Max: 5747.00, Min: 1486.00, Avg: 3290.39, StdDev: 1140.08

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    /benchmark

    3 similar comments
    @gabriel-aranha-cw
    Copy link
    Contributor

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-1144793677

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2821.00, Min: 1571.00, Avg: 2454.83, StdDev: 151.99
    TPS Stats: Max: 2803.00, Min: 2134.00, Avg: 2384.18, StdDev: 162.06

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.28, StdDev: 0.45
    Imported Transactions/s: Max: 5378.00, Min: 282.00, Avg: 3120.03, StdDev: 1077.06

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-257839399

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 3000.00, Min: 1700.00, Avg: 2763.64, StdDev: 115.55
    TPS Stats: Max: 3004.00, Min: 2358.00, Avg: 2683.26, StdDev: 130.42

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.16, StdDev: 0.37
    Imported Transactions/s: Max: 5805.00, Min: 202.00, Avg: 3201.27, StdDev: 1034.34

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-3403160980

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2896.00, Min: 1571.00, Avg: 2622.03, StdDev: 125.50
    TPS Stats: Max: 2956.00, Min: 2289.00, Avg: 2546.53, StdDev: 134.20

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.20, StdDev: 0.40
    Imported Transactions/s: Max: 5668.00, Min: 816.00, Avg: 3142.11, StdDev: 1060.35

    Plots:

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-744840059

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2857.00, Min: 1698.00, Avg: 2576.84, StdDev: 128.32
    TPS Stats: Max: 2862.00, Min: 2096.00, Avg: 2501.81, StdDev: 139.59

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.22, StdDev: 0.42
    Imported Transactions/s: Max: 5587.00, Min: 1708.00, Avg: 3149.70, StdDev: 1083.59

    Plots:

    @carneiro-cw
    Copy link
    Contributor Author

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-4261859532

    Git Info:

    Configuration:

    • Target Account Strategy: Default

    Leader Stats:
    RPS Stats: Max: 2697.00, Min: 1578.00, Avg: 2446.45, StdDev: 107.17
    TPS Stats: Max: 2701.00, Min: 2117.00, Avg: 2375.62, StdDev: 119.99

    Follower Stats:
    Imported Blocks/s: Max: 2.00, Min: 1.00, Avg: 1.42, StdDev: 0.49
    Imported Transactions/s: Max: 5363.00, Min: 13.00, Avg: 3460.96, StdDev: 1235.53

    Plots:

    @carneiro-cw
    Copy link
    Contributor Author

    /benchmark

    @gabriel-aranha-cw
    Copy link
    Contributor

    Benchmark:
    Run ID: bench-211892405

    Git Info:

    Leader Stats:
    RPS Stats: Max: 3520.00, Min: 1893.00, Avg: 3088.43, StdDev: 165.55
    TPS Stats: Max: 3526.00, Min: 1750.00, Avg: 3087.65, StdDev: 167.99

    Follower Stats:
    Imported Blocks/s: Max: 8.00, Min: 3.00, Avg: 6.12, StdDev: 0.92
    Imported Transactions/s: Max: 24408.00, Min: 7216.00, Avg: 18903.98, StdDev: 2769.95

    Plots:

    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.

    2 participants