News for hackers. Stuff that matters.
Re:Fish – Update on the Rust Port by kstrauser on Sunday November 26, 2023 @02:43PM (#38424331)
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.

Re:Fish – Update on the Rust Port by coldtea on Sunday November 26, 2023 @02:58PM (#38424453)
>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.

Re:Fish – Update on the Rust Port by arp242 on Sunday November 26, 2023 @03:22PM (#38424646)
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

Re:Fish – Update on the Rust Port by kstrauser on Sunday November 26, 2023 @03:45PM (#38424866)
True, but I can get the same functionality with fish without the functionality. 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.
Re:Fish – Update on the Rust Port by lkbm on Sunday November 26, 2023 @02:51PM (#38424389)
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.

Re:Fish – Update on the Rust Port by paradox460 on Sunday November 26, 2023 @03:04PM (#38424499)
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

Re:Fish – Update on the Rust Port by dividedbyzero on Sunday November 26, 2023 @03:05PM (#38424506)
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.

Re:Fish – Update on the Rust Port by arp242 on Sunday November 26, 2023 @03:29PM (#38424716)
zsh has the same; just add "zmodload zsh/zprof" at the top and "zprof" at the bottom of your zshrc.