Bonfida / dex-v4

Orderbook-based on-chain SPL token swap market
99 stars 32 forks source link

Optimize compute units via compiler flags #23

Open armaniferrante opened 2 years ago

armaniferrante commented 2 years ago

The following Cargo.toml settings have been shown to reduce compute units

[profile.release]
lto = "fat"
codegen-units = 1

[profile.release.build-override]
opt-level = 3
incremental = false
codegen-units = 1

Example here https://github.com/project-serum/serum-dex/pull/159

ellttBen commented 2 years ago

@armaniferrante is this still relevant? If so I don't understand why this isn't the default setting. Is there a hidden tradeoff?

armaniferrante commented 2 years ago

Slower compile times is the only one I'm aware of.