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 8, 2023
1 parent 24ad866 commit 9bb1b74
Show file tree
Hide file tree
Showing 21 changed files with 0 additions and 21 deletions.
1 change: 0 additions & 1 deletion cargo-pgx/src/templates/cargo_toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pgx-tests = "=0.7.1"

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

[profile.release]
panic = "unwind"
Expand Down
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
1 change: 0 additions & 1 deletion pgx-examples/aggregate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/bgworker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/bytea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/composite_type/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/custom_sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/custom_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/nostd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/numeric/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }

#[profile.dev]
#panic = "unwind"
#lto = "thin"
#
#[profile.release]
#panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/operators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/pgtrybuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/schemas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/shmem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/spi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/spi_srf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/srf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/strings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
# [profile.dev]
# panic = "unwind"
# lto = "thin"

# [profile.release]
# panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/triggers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
#[profile.dev]
#panic = "unwind"
# lto = "thin"

#[profile.release]
#panic = "unwind"
Expand Down
1 change: 0 additions & 1 deletion pgx-examples/versioned_so/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
# uncomment these if compiling outside of 'pgx'
#[profile.dev]
#panic = "unwind"
# lto = "thin"

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

0 comments on commit 9bb1b74

Please sign in to comment.