Repository navigation
Conversation
Every install runs about 100 scripts through run_logged. Each call previously spawned a fresh bash process via execve, adding ELF loading and shell startup overhead on every leaf. Run each script in a forked subshell instead, clearing nounset and pipefail and resetting IFS before sourcing the leaf. A zero-fork ERR trap probe detects when a caller invoked run_logged inside an errexit-suppressed context such as `if ! run_logged` (used by omarchy-provision-hardware) and falls back to `exec bash -eE` in the same PID so `set -e` still aborts on failure. 100 empty leaves drop from 125.5 ms to 49.3 ms on Bash 5.3.
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable failures were found. Summary
|
|
Recommend: Hold — the maintainer should weigh the measured speedup against maintaining two Bash execution contexts. The CLI suite and six installer test files passed on an ISO worker. A benchmark of 100 empty leaves saved 51 ms. Direct setup now inherits caller variables and functions, and deferred first boot still starts a fresh Bash process. Codex High, Opus 5.5 High, and muse-wonder via pi (high effort) found no regression in the current leaves. The reviews could see the same session context. |
What changes
Every install executes around 100 setup scripts through
run_loggedininstall/helpers/logging.sh. Each call previously launched a newbashprocess viaexecve, paying ELF loading and startup cost on every leaf.run_loggednow runs each leaf in a forked subshell (_omarchy_run_logged_script), resettingset +u,set +o pipefail,IFS, andPS4before enablingset -eEand sourcing the script. Inside the subshell, a zero-forkERRtrap probe checks whether the caller suppressederrexit(for exampleif ! run_loggedinomarchy-provision-hardware) and falls back toexec bash -eEin the same PID so failures still abort immediately.This keeps caller isolation intact, leaves
OMARCHY_INSTALL_DEBUG=1tracing unchanged, and reverts cleanly in one commit.Verification
test/shell.d/pkg-drop-test.shfailed onorigin/quattrobecause normalrun_loggedcalls invokedbashonPATH.pkg-drop-test.sh,hw-platform-test.sh,image-target-platform-test.sh,apply-lock-test.sh,dgx-spark-boot-test.sh, andplatform-setup-test.shall pass on Bash 5.3.125.5 msto49.3 ms.Screenshots
No visible change: internal installer helper in
install/helpers/logging.sh.