strata, flea: compile the test harness in parallel

Both upstreams set fat LTO in their release profile (strata also
codegen-units = 1), which compiles the final crate on one thread. That
is a reasonable trade for the binary users run, and build() keeps it.
check() then compiled the same crate a second time under the same
profile for the test harness, and threw it away. On the aarch64 builds,
which run under QEMU, those two serial compiles were 106 of strata's
118 minutes.

check() now builds the harness with thin LTO and 16 codegen units in
its own target directory. The shipped binary is unchanged. Measured on
the x86_64 builder for strata's test binary: 708 s serial, 223 s with
this profile. Local run: shipped strata still 7m30s from target/, tests
3m43s from target-check/, 1998 passed.

ttfx has the same upstream profile but no check(), so nothing to do.
This commit is contained in:
Ryan Hughes committed 2026-09-21 02:23:36 -04:00
1 parent cb8aae545e
commit ec81434684
2 files changed
+19 -4

No files matched your search

+8 -2
View File
@@ -2,7 +2,7 @@
pkgname=flea
pkgver=0.3.1
pkgrel=1
pkgrel=2
pkgdesc='Fast, keyboard-first file manager for Omarchy'
arch=('x86_64' 'aarch64')
url='https://github.com/thisisgm/flea'
@@ -64,7 +64,13 @@ build() {
check() {
cd "$pkgname-$pkgver"
export CARGO_TARGET_DIR=target
# Upstream's release profile uses fat LTO, whose final link runs on one
# thread. build() keeps it for the shipped binary; the test harness is a
# throwaway second compile, so build it in parallel in its own target
# directory.
export CARGO_TARGET_DIR=target-check
export CARGO_PROFILE_RELEASE_LTO=thin
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
local -a test_args=()
if ! /usr/bin/prlimit --cpu=30 --as=1073741824 \
+11 -2
View File
@@ -1,6 +1,6 @@
pkgname=strata
pkgver=0.19.0
pkgrel=1
pkgrel=2
pkgdesc='Fast, keyboard-first file manager for modern Linux desktops'
arch=('x86_64' 'aarch64')
url='https://github.com/lgse/strata'
@@ -69,7 +69,16 @@ build() {
check() {
cd "$pkgname-$pkgver"
export CARGO_TARGET_DIR=target
# Upstream's release profile is fat LTO with one codegen unit, which
# compiles the final crate on a single thread. That is the right trade
# for the binary users run, and build() keeps it. The test harness is a
# second compile of the same crate under the same profile, thrown away
# afterwards; build it in parallel, in its own target directory so the
# shipped binary is untouched. Measured on the x86_64 builder: 708 s
# serial, 223 s with thin LTO and 16 units.
export CARGO_TARGET_DIR=target-check
export CARGO_PROFILE_RELEASE_LTO=thin
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
export STRATA_BUILD_COMMIT
STRATA_BUILD_COMMIT=$(<.build-commit)
export STRATA_RELEASE_TAG="v$pkgver"