Skip to content

Commit

Permalink
Only enable line tables for profile.dev (#1249)
Browse files Browse the repository at this point in the history
This reduces the size of target after running tests from ~8GB to ~5GB,
and makes them complete a good amount faster (generating debug info is
slow). It only really makes a difference if you're going to use a
debugger, in which case perhaps you should just turn that flag off.

The size and speed saving make me think it should be done generally,
rather than only for CI.

---------

Co-authored-by: Jubilee Young <[email protected]>
  • Loading branch information
thomcc and workingjubilee authored Aug 9, 2023
1 parent c68b4ab commit 64bedaf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,11 @@ jobs:
# ls -lath `$(which pg_config) --pkglibdir` `$(which pg_config) --sharedir`/extension
echo ""
echo "----- Output Cargo version -----"
cargo --version
echo "----- Stable Rust ----"
rustup update stable
rustup default stable
rustc -vV
cargo -vV
echo ""
echo "----- Outputting env -----"
Expand Down
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ members = [
"pgrx-examples/spi_srf",
]

[profile.dev]
# Only include line tables in debuginfo. This reduces the size of target/ (after
# running tests) by almost half, while keeping the part of debuginfo which
# people care about the most (the part used to produce backtraces). This seems
# like something we would generally want (when actually running in a debugger
# you can just comment out the line).
#
# That said, if it turns out to hurt development more than expected, we could
# move this to only toggle this in CI
debug = 'line-tables-only'

[profile.dev.build-override]
opt-level = 3

Expand Down

0 comments on commit 64bedaf

Please sign in to comment.