Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
⚡️ build optimization for speed (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelStark authored Jul 4, 2023
1 parent 0143c73 commit b994040
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b994040

Please sign in to comment.