Skip to content

improve performance and maintainability#328

Merged
ss-o merged 3 commits into
fix-variablesfrom
perf-zicompinit-fast
Jun 16, 2025
Merged

improve performance and maintainability#328
ss-o merged 3 commits into
fix-variablesfrom
perf-zicompinit-fast

Conversation

@ss-o

@ss-o ss-o commented Jun 16, 2025

Copy link
Copy Markdown
Member

This pull request refines the zicompinit_fast function in the zi.zsh file to improve performance and maintainability. The changes include replacing outdated logic, adding support for Ubuntu-specific configurations, and enhancing the handling of .zcompdump and .zwc files.

Performance and maintainability improvements:

  • Updated the logic to check for Ubuntu systems using grep on /etc/os-release and set the skip_global_compinit variable accordingly. This replaces the previous commented-out code for Ubuntu detection.
  • Simplified the .zcompdump lock file handling by replacing the old .augur file logic with a .lock file check, ensuring regeneration occurs only if the lock file is older than 24 hours.
  • Replaced the manual .zwc file compilation with the zrecompile command for better efficiency and clarity. The new implementation ensures .zwc files are regenerated in the background when necessary.

Code readability and modernization:

  • Replaced redundant comments and outdated variable naming conventions with more concise and clear explanations, improving the readability of the function.
  • Added builtin to the autoload command for compinit and `z

ss-o and others added 2 commits August 8, 2023 10:58
…erated adds a noticable delay to zsh startup.

This restricts checking it once a day, determines when to regenerate compinit (it doesn't need to modify the compdump everytime) and compiles mapped to share (total mem reduction) run in background in multiple shells. A function that can be invoked from within `atinit', `atload', e.g: zi ice atinit'zicompinit_fast'; zi load user/repository.

Signed-off-by: Salvydas Lukosius <sall@w-ss.io>
@ss-o
ss-o requested a review from a team as a code owner June 16, 2025 08:55
@ss-o
ss-o merged commit 6a6a35a into fix-variables Jun 16, 2025
29 of 30 checks passed
@ss-o
ss-o deleted the perf-zicompinit-fast branch June 20, 2025 21:20
@github-actions

Copy link
Copy Markdown

Pull Request closed and locked due to lack of activity.
If you'd like to build on this closed PR, you can clone it using this method: https://stackoverflow.com/a/14969986
Then open a new PR, referencing this closed PR in your message.

@github-actions github-actions Bot locked and limited conversation to collaborators Jun 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant