diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 99f45e4d44..a7fc96662b 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -45,7 +45,7 @@ jobs: cd ../benchmarking npm i - name: Build madara in release mode - run: cargo build --workspace --release + run: cargo build --profile production -p madara - name: Run benchmark run: | cd benchmarking diff --git a/Cargo.toml b/Cargo.toml index 2694f90e42..9d9330af39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,17 @@ members = [ "crates/client/storage", "crates/client/transaction-pool", ] + [profile.release] panic = "unwind" +[profile.production] +inherits = "release" +codegen-units = 1 # Setting this to 1 allows for more optimizations at the cost of slower compile time +lto = true # Enables Link Time Optimization, enabling more aggressive optimizations across the entire codebase +opt-level = 3 # Optimize for speed regardless of binary size or compile time +rpath = false # Disables adding rpath to the binary + [workspace.package] authors = ["Abdelhamid Bakhta <@abdelhamidbakhta>"] edition = "2021"