mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-11-23 21:54:45 +02:00
release: finally switch to LTO for release binaries
There seems to be a modest improvement on some workloads: ``` $ time rg -co '\w+' sixteenth.txt 158520346 real 8.457 user 8.426 sys 0.020 maxmem 779 MB faults 0 $ time rg-lto -co '\w+' sixteenth.txt 158520346 real 8.200 user 8.178 sys 0.012 maxmem 778 MB faults 0 ``` I've somewhat reversed course on my previous thoughts here. The improvement isn't much, but the hit to compile times in CI isn't terrible. Mostly I'm doing this out of "good sense," and I think it's generally unlikely to make it more difficult for me to diagnose performance problems. (Since I still use the default `release` profile locally, since it's about an order of magnitude quicker to compile.) Ref #325, Ref #413, Ref #1187, Ref #1255
This commit is contained in:
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -176,11 +176,11 @@ jobs:
|
|||||||
- name: Build release binary
|
- name: Build release binary
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
${{ env.CARGO }} build --verbose --release --features pcre2 ${{ env.TARGET_FLAGS }}
|
${{ env.CARGO }} build --verbose --profile release-lto --features pcre2 ${{ env.TARGET_FLAGS }}
|
||||||
if [[ "${{ matrix.os }}" == windows-* ]]; then
|
if [[ "${{ matrix.os }}" == windows-* ]]; then
|
||||||
bin="target/${{ matrix.target }}/release/rg.exe"
|
bin="target/${{ matrix.target }}/release-lto/rg.exe"
|
||||||
else
|
else
|
||||||
bin="target/${{ matrix.target }}/release/rg"
|
bin="target/${{ matrix.target }}/release-lto/rg"
|
||||||
fi
|
fi
|
||||||
echo "BIN=$bin" >> $GITHUB_ENV
|
echo "BIN=$bin" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|||||||
@@ -86,12 +86,8 @@ panic = "abort"
|
|||||||
incremental = false
|
incremental = false
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|
||||||
# This is the main way to strip binaries in the deb package created by
|
|
||||||
# 'cargo deb'. For other release binaries, we (currently) call 'strip'
|
|
||||||
# explicitly in the release process.
|
|
||||||
[profile.deb]
|
[profile.deb]
|
||||||
inherits = "release"
|
inherits = "release-lto"
|
||||||
debug = false
|
|
||||||
|
|
||||||
[package.metadata.deb]
|
[package.metadata.deb]
|
||||||
features = ["pcre2"]
|
features = ["pcre2"]
|
||||||
|
|||||||
Reference in New Issue
Block a user