zap-zsh / zap

:zap: Zap is a minimal zsh plugin manager
https://www.zapzsh.com/
GNU General Public License v3.0
942 stars 33 forks source link

Startup Time longer then oh-my-zsh #174

Closed wkocmann closed 6 months ago

wkocmann commented 10 months ago

Describe the bug

Right now startup time is about 3 times as long as oh-my-zsh.

I am using a very minimalist setup with the following plugins

1 🔌 conda-zsh-completion 2 🔌 zsh-autosuggestions 3 🔌 supercharge 4 🔌 vim 5 🔌 nvm 6 🔌 zap-prompt 7 🔌 fzf 8 🔌 zsh-syntax-highlighting

and startup takes longer then oh-my-zsh.

Steps to reproduce

Start a new window in tmux or any other shell.

Tested on Linux (x84 and ARM) and Mac (M2)

Expected behavior

Faster Start Ups

Screenshots and recordings

No response

OS / Linux distribution

macOS 13.5.2, EndeavourOS Linux x86_64, Raspberry Pi OS Bookworm

Zsh version

5.9

Zap version

release-v1/1.2.1

Terminal emulator

Alacritty

If using WSL on Windows, which version of WSL

None

Additional context

No response

trekie86 commented 8 months ago

I'd recommend measuring what is taking the longest via https://stevenvanbael.com/profiling-zsh-startup

For me, it was nvm by a very long shot. Currently researching if there are other options to lazy load nvm since that is the biggest driver.

trekie86 commented 8 months ago

This plugin seems to be eliminating my pain point and only paying the penalty once when I need to use nvm vs every startup: https://github.com/undg/zsh-nvm-lazy-load

ChristianChiarulli commented 8 months ago

@trekie86 have you tried fnm?

ChristianChiarulli commented 8 months ago

start up time can be a pretty deceptive metric, not sure that this is the case here but I just want to make sure we keep that in mind. Are you able to narrow down which if any plugin may be causing the startup to take significantly longer?

wkocmann commented 8 months ago

This plugin seems to be eliminating my pain point and only paying the penalty once when I need to use nvm vs every startup: https://github.com/undg/zsh-nvm-lazy-load

Thank you, that did the trick. Now it is blazingly fast

trekie86 commented 8 months ago

@trekie86 have you tried fnm?

I have not tried fnm, I'll give it a shot and see if that performs better than nvm...I suspect it will.