5 ms·
Is shell performance a limitation for some workflows? I naively think of it as some glue which shunts the work elsewhere. Maybe in the efficiency of pipe? I sup
by fbdab103 3y ago
Is shell performance a limitation for some workflows? I naively think of it as some glue which shunts the work elsewhere. Maybe in the efficiency of pipe? I suppose those lunatics who write full programs in bash?
I will always take faster code, but that seems like an odd bulletpoint to highlight given the many quality of life improvements fish has to offer.
- kstrauser 3y agoKind 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.
- lkbm 3y agoI 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.
- paradox460 3y agoYou 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 https://github.com/jdx/rtx [2] https://github.com/asdf-vm/asdf https://github.com/asdf-vm/asdf
- dividedbyzero 3y agofish 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.
- arp242 3y agozsh has the same; just add "zmodload zsh/zprof" at the top and "zprof" at the bottom of your zshrc.
- coldtea 3y ago>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.
- arp242 3y agoSee 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 https://news.ycombinator.com/item?id=38421199
- kstrauser 3y agoTrue, 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.
- jonS90 3y agoIf it takes 5 seconds for your prompt to display or become interactive, yes. As far as I'm aware, most of the other quality of life improvements can be reproduced in zsh with plugins. This performance bulletpoint makes me want to consider switching back to fish from zsh.
- TheFuzzball 3y agoThis. Also completion performance.