perf(conf.d): cut shell startup latency by ~30% #130
No Reviewers
Labels
Clear labels
Area/CI
Area/Completions
Area/Components
Area/Config
Area/Docs
Area/Functions
Area/Integrations
Area/Prompt & Theme
Area/Scripts
Area/Tests
Compat/Breaking
Kind/Bug
Kind/Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Refactor
Kind/Security
Kind/Testing
good first issue
help wanted
.github/workflows and repository automation
completions/ - tab-completion scripts
The opinionated-component system (C1-C6)
config.fish and conf.d/ - startup and environment
docs/manual/ and the generated manual, man page, and site
functions/ - user-facing functions and helpers
integrations/ - third-party tool wiring
themes/ and prompt appearance
scripts/ - standalone helper scripts
tests/ - the syntax lint and functional suite
Breaking change that won't be backward compatible
Something is not working
Tooling, dependencies, and housekeeping
Documentation changes
Improve existing functionality
New functionality
Makes existing behavior faster or lighter
Restructures code without changing behavior
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Well-scoped and self-contained; a good place to start
Maintainer is looking for someone to pick this up
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
rootiest (Rootiest)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rootiest/fish-config#130
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
conf.d/tailscale.fishwas a Cobra-generated completion script living inconf.d/, so fish sourced it — and it self-primed by running thetailscalebinary — on every shell start, interactive or not.conf.d/cheat.fishwas the same mistake. Both are relocated tocompletions/, where fish loads them lazily on first<TAB>.Nine more
conf.d/*.fishfiles (abbr,bash_expands,key_bindings,starship,theme,auto-pull,wakatime,logging-events,paru-wrapper/yay-wrapper) do work only an interactive session can use, and had nostatus is-interactiveguard — so every non-interactivefish -cpaid for abbreviations, key bindings, the theme, etc. Each now guards.Measured (interleaved, same machine, before/after this branch)
fish -c 'true'fish -i -c 'exit'Why each guard is safe (not just faster)
Every guarded file was traced for script callers before guarding — see individual commit messages for the one-line evidence each. Two files were deliberately not guarded despite being candidates:
conf.d/__fish_config_op_registry.fish— it defines the variables the guard helper reads, and that helper fails open on a missing registry entry. Guarding it would silently re-enable every opinionated component inside scripts.conf.d/tricks.fish— mixed file with script-callable functions (backup,psmem) alongside interactive-only pieces.tailscale<TAB>and completion laziness verified in a real PTY, not justcomplete -C.Out of scope, recorded not fixed
See
AGENTS/JOB-BRIEF-FINDINGS.mdin this branch (untracked — copy it out if you want to keep it) for two deferred items: a double-source oftricks.fishon CachyOS (4.55 ms/shell, needs its own branch because the fix requires hard-coding a foreign registry identity), and a conflicting-wrapper bug betweenparu-wrapper.fishand__fish_config_sync_logging.fish.Testing
fish tests/run-tests.fish— 226/226 lint, 17/17 functional, 317/317 vault.python3 docs/verify-manual.py— 74/74. New regression test (test_conf_d_is_lazy_in_scripts) proven red-then-green by stashing the guards and reverting.