Skip to content

Commit 9bb1b74

Browse files
committed
Disable thin lto for dev builds by default in template
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.
1 parent 24ad866 commit 9bb1b74

File tree

21 files changed

+0
-21
lines changed

21 files changed

+0
-21
lines changed

cargo-pgx/src/templates/cargo_toml

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pgx-tests = "=0.7.1"
2323

2424
[profile.dev]
2525
panic = "unwind"
26-
lto = "thin"
2726

2827
[profile.release]
2928
panic = "unwind"

nix/templates/default/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ once_cell = "1.7.2"
2525

2626
[profile.dev]
2727
panic = "unwind"
28-
lto = "thin"
2928

3029
[profile.release]
3130
panic = "unwind"

pgx-examples/aggregate/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pgx-tests = { path = "../../pgx-tests" }
2626
# uncomment these if compiling outside of 'pgx'
2727
# [profile.dev]
2828
# panic = "unwind"
29-
# lto = "thin"
3029

3130
# [profile.release]
3231
# panic = "unwind"

pgx-examples/bgworker/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
2424
# uncomment these if compiling outside of 'pgx'
2525
# [profile.dev]
2626
# panic = "unwind"
27-
# lto = "thin"
2827

2928
# [profile.release]
3029
# panic = "unwind"

pgx-examples/bytea/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/composite_type/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/custom_sql/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/custom_types/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pgx-tests = { path = "../../pgx-tests" }
2727
# uncomment these if compiling outside of 'pgx'
2828
# [profile.dev]
2929
# panic = "unwind"
30-
# lto = "thin"
3130

3231
# [profile.release]
3332
# panic = "unwind"

pgx-examples/errors/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
2424
# uncomment these if compiling outside of 'pgx'
2525
# [profile.dev]
2626
# panic = "unwind"
27-
# lto = "thin"
2827

2928
# [profile.release]
3029
# panic = "unwind"

pgx-examples/nostd/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/numeric/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525

2626
#[profile.dev]
2727
#panic = "unwind"
28-
#lto = "thin"
2928
#
3029
#[profile.release]
3130
#panic = "unwind"

pgx-examples/operators/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/pgtrybuilder/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
2424
# uncomment these if compiling outside of 'pgx'
2525
# [profile.dev]
2626
# panic = "unwind"
27-
# lto = "thin"
2827

2928
# [profile.release]
3029
# panic = "unwind"

pgx-examples/schemas/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/shmem/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pgx-tests = { path = "../../pgx-tests" }
2626
# uncomment these if compiling outside of 'pgx'
2727
# [profile.dev]
2828
# panic = "unwind"
29-
# lto = "thin"
3029

3130
# [profile.release]
3231
# panic = "unwind"

pgx-examples/spi/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
2424
# uncomment these if compiling outside of 'pgx'
2525
# [profile.dev]
2626
# panic = "unwind"
27-
# lto = "thin"
2827

2928
# [profile.release]
3029
# panic = "unwind"

pgx-examples/spi_srf/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/srf/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
# [profile.dev]
2727
# panic = "unwind"
28-
# lto = "thin"
2928

3029
# [profile.release]
3130
# panic = "unwind"

pgx-examples/strings/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
2424
# uncomment these if compiling outside of 'pgx'
2525
# [profile.dev]
2626
# panic = "unwind"
27-
# lto = "thin"
2827

2928
# [profile.release]
3029
# panic = "unwind"

pgx-examples/triggers/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pgx-tests = { path = "../../pgx-tests" }
2525
# uncomment these if compiling outside of 'pgx'
2626
#[profile.dev]
2727
#panic = "unwind"
28-
# lto = "thin"
2928

3029
#[profile.release]
3130
#panic = "unwind"

pgx-examples/versioned_so/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pgx-tests = { path = "../../pgx-tests" }
2424
# uncomment these if compiling outside of 'pgx'
2525
#[profile.dev]
2626
#panic = "unwind"
27-
# lto = "thin"
2827

2928
#[profile.release]
3029
#panic = "unwind"

0 commit comments

Comments
 (0)