Skip to content

Commit

Permalink
Add custom profile for debug builds with basic optimizations
Browse files Browse the repository at this point in the history
Regular debug builds need to be debuggable according to the
principle of least surprise. This is also expected by tools.

There is a need for optimized builds with assertions enabled
so we add that as a custom profile instead.
  • Loading branch information
thedataking committed Dec 6, 2023
1 parent 61ca0d9 commit 48b44bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# release build without optimized assembly routines
{name: "release", flags: "--release --no-default-features --features=bitdepth_8,bitdepth_16", timeout_multiplier: 1},
# debug build to catch overflows with optimized assembly routines
{name: "debug", flags: "", timeout_multiplier: 2}
{name: "opt-dev", flags: "--profile opt-dev", timeout_multiplier: 2}
]
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ asm = []
bitdepth_8 = []
bitdepth_16 = []

[profile.dev]
# As we port, we increasingly use operations that require more optimizations to be zero-cost,
# so while `--release` perf stays the same, debug perf suffers a lot,
# unless we enable the basic optimizations (`opt-level = 1`),
# which don't increase compile-time that much.
[profile.opt-dev]
# The debug builds run tests very slowly so this profile keeps debug assertions
# while enabling basic optimizations. The profile is not suitable for debugging.
inherits = "dev"
opt-level = 1

[profile.release]
Expand Down

0 comments on commit 48b44bd

Please sign in to comment.