Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Kind of, yeah. When I used zsh, oh-my-zsh made the shell startup a lot slower, even though I wasn’t going crazy with the customizations. Opening a new terminal tab would take a couple seconds to get a prompt. My current fish setup is imperceptibly fast to start.

Those little delays add friction. Not an intolerable amount, sure, but it’s there. While I switched to fish for other reasons, that alone would keep me from going back now.



>Kind of, yeah. When I used zsh, oh-my-zsh made the shell startup a lot slower, even though I wasn’t going crazy with the customizations

A lot or most of that wasn't zsh being slow though, but oh-my-zsh calling out to external programs (like git to get powerline info and such) and them being slow.


See my other comment from earlier today[1] – launching 230 external programs (even very simple ones, /bin/[ in this case) takes about half a second. Since I would rate anything as >100ms to be a "noticeable delay" you have a "budget" of about 40 external processes, probably a bit less in real-world conditions (depending on which utilities you're using and what it's doing).

And that's 40 C processes. "python empty.py" takes about 30ms to 40ms due to the interpreter startup time; empty C file is about 2ms, "sh empty.sh" is about 4ms.

Please think that "launching external programs is fast and modern computers are fast, so why worry about this?", and that's true, but it's also not. Add up a few dozen and turns out it's actually quite slow.

[1]: https://news.ycombinator.com/item?id=38421199


True, but I can get the same functionality with fish without the slowdown. I don’t think zsh is bad. I understand what was making it slow. I’m just glad I can have all of those niceties plus fish’s speed.


I once spent a while adding timings between each item in my zsh config files to find what was slowest.

The nvm init was the worst of it, so now I have an alias for `$NVM_DIR/nvm.sh ] && \. "$NVM_DIR/nvm.sh" && \. $NVM_DIR/bash_completion` I just run manually before using nvm, rather than letting it slow me down half a second or whatever it was every time I open a new terminal.

It's worth poking around if things get slow enough to be a pain. There's a decent chance it's 1-2 things that you don't even care about all that much.


You might check out rtx[1]

Its an asdf[2] rewrite, in rust, that can do most of the things nvm can

[1] https://github.com/jdx/rtx

[2] https://github.com/asdf-vm/asdf


fish actually has a built-in profiler for its startup that can be enabled via an argument:

> --profile-startup=PROFILE_FILE > Will write timing for fish startup to specified file.


zsh has the same; just add "zmodload zsh/zprof" at the top and "zprof" at the bottom of your zshrc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: