Skip to content

Commit

Permalink
Disable thin lto for dev builds by default in template
Browse files Browse the repository at this point in the history
When changing something trivial in the hello world project created by
`cargo pgx new`, it would take ~20 seconds to compile a dev build of the
generated crate on my machine. This seemed way slower than it should be.
It turns out that the thin LTO setting greatly inrceases compilation
times. By disabling it, compilation time of the crate is only 1 second.

As far as I can tell this setting was enabled initially as a workaround
for this bug in Rust: rust-lang/rust#50007
Since this bug has been fixed since Rust 1.62, and current stable Rust
is version 1.67, this PR removes the workaround.
  • Loading branch information
JelteF committed Feb 6, 2023
1 parent 24ad866 commit 46ac0c9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion nix/templates/default/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ once_cell = "1.7.2"

[profile.dev]
panic = "unwind"
lto = "thin"

[profile.release]
panic = "unwind"
Expand Down

0 comments on commit 46ac0c9

Please sign in to comment.