build: Enable LTO for release builds

This reduces `liblimbo_sqlite3.a` binary size from 25 MB to 10 MB:

Before:

  $ -lh ../target/release/liblimbo_sqlite3.a
  -rw-r--r--  1 penberg  staff    25M 15 Mar 18:36 ../target/release/liblimbo_sqlite3.a

After:

  $ penberg@vonneumann sqlite3 % ls -lh ../target/release/liblimbo_sqlite3.a
  -rw-r--r--  1 penberg  staff   9,9M 15 Mar 18:59 ../target/release/liblimbo_sqlite3.a
This commit is contained in:
Pekka Enberg
2024-11-15 18:59:45 +02:00
parent 9d96b22b4a
commit c3da75d260
2 changed files with 252 additions and 243 deletions

492
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -46,6 +46,9 @@ dist = false
# Whether to enable GitHub Attestations
github-attestations = true
[profile.release]
lto = true
[profile.dist]
inherits = "release"
lto = "thin"