Live data from Hacker News

Speeding up my ZSH shell

scottspence.com

61–70 of 133 posts

Re: Speeding up my ZSH shell

#61

Earlier quoted context omitted.

Sadly it's essentially discontinued

No. The author simply sees it as basically complete and decided to spend the time he has fixing bugs instead of taking care of issues.

> MOST BUGS WILL GO UNFIXED

Re: Speeding up my ZSH shell

#62

Earlier quoted context omitted.

Out of curiosity, what is wrong with oh-my-zsh? I use it and never had any issue. Am I missing out on something?

If it works for you, that's great. But people are installing oh-my-zsh almost as if it's an official requirement of zsh, run into bloat and performance issues, and goes off telling everybody not to use zsh. Some of the autocompletion settings set by oh-my-zsh are useful. But apart from that, the majority of the code consists of gazillions of random aliases and functions that someone else needed. It pollutes the comma…

OMZ shouldn’t be imposing these issues, and autoupdates of a shell script manager is aesthetically disgusting. But there’s also an argument to be made for not cargo culling configuration.

Re: Speeding up my ZSH shell

#63
There's so many plugin systems for zsh. From comments it seems like Pretzo is the main one suggested.

But there's a huge list of different offerings. Looking at https://github.com/sindresorhus/pure?tab=readme-ov-file#inte... , there's also for example zim, zplug, zinit, zi. It's be so great to have see some deeper investigations or comparisons: is Pretzo really the best choice? Aside from seeming popularity, why?

At least found this neat gist with a cheat sheet for different zsh plugin systems (and how very many there are!) https://gist.github.com/olets/06009589d7887617e061481e22cf5a...

Re: Speeding up my ZSH shell

#64

With articles like these popping up all the time, oh-my-zsh is seriously harming zsh's reputation. It's giving the wrong impression of zsh being slow and bloated. zsh doesn't need configuration frameworks or plugins. All it needs is a change in the default settings so that its powerful completion works out the box. It currently needs more than ideal amount of tweaks to the defaults, which is probably why people flock…

I don't want to spend ages figuring out which knobs to turn to get a half decent shell. If there's an alternative to oh-my-zsh that looks halfway decent, has that nice fzf integrated, and the 'ghost text' history suggestions, then I welcome it!

IMO, that alternative is Fish shell.

Re: Speeding up my ZSH shell

#66

With articles like these popping up all the time, oh-my-zsh is seriously harming zsh's reputation. It's giving the wrong impression of zsh being slow and bloated. zsh doesn't need configuration frameworks or plugins. All it needs is a change in the default settings so that its powerful completion works out the box. It currently needs more than ideal amount of tweaks to the defaults, which is probably why people flock…

I don't want to spend ages figuring out which knobs to turn to get a half decent shell. If there's an alternative to oh-my-zsh that looks halfway decent, has that nice fzf integrated, and the 'ghost text' history suggestions, then I welcome it!

Zim has been my choice since I got sick of multi second startups with OMZ.

Re: Speeding up my ZSH shell

#67

As a long time Linux + bash user I switched to zsh three months ago when I was forced to use a Mac at a new job. In every previous job I was able to insist on Linux, but this one is very corporate. I decided not to fight it, except to install AltTab, Karabiner, Rectangle and a script that detects which screen my mouse is on so I can alt-tab through ALL the stuff on that screen (sane XFCE / KDE behaviour). I can't get…

What on earth are you talking about? zsh isn't bloated by any stretch, nor is it any slower than bash in any meaningful way. Chances are, like in the article, you installed oh-my-zsh, a third party configuration framework.

Some data in support of @soraminazuki (who makes good points throughout this thread) on an i7-1370P linux laptop running Linux 6.15.7:

    $ tim 'bash -lic logout' 'zsh -lic logout'
    55.3 +- 3.7 μs  (AlreadySubtracted)Overhead
    7454 +- 26 μs   bash -lic logout
    7934 +- 39 μs   zsh -lic logout
(Using https://github.com/c-blake/bu/blob/main/doc/tim.md)

About 20,000 entries in the Zsh history slowing it a little. All completion activated (but zcompile'd, along with a very large digraphs.zwc).

I think most would not be troubled by taking 1.06X longer, though, especially at this 8 ms scale and for interactive session initiation. Note this test upper bounds Time To First Prompt { a different "TTFP" from Time To First Plot ;-) }, since it also exits as part of the `-c`.

Re: Speeding up my ZSH shell

#68

Earlier quoted context omitted.

You should try fish shell. Great user experience out of the box, including history suggestions. https://fishshell.com

The incompatible syntax of fish makes it a no go for me. As an SRE, at my day job I often need to copy/paste commands that are generated from a playbook. Our playbooks use Bash, and in practice Zsh is compatible. But a co-worker using fish often has to manually modify commands before running, and I'm not about that life. The problem with fish is mostly the different syntax for setting variables and lack of heredocs.…

Exactly. Variable assignment works different in Fish, and it’s very hard to change that habit. With my usage of shell (with Fzf & zoxide), fish simply doesn’t improve much for me. I’m using bash constantly for my job, and having the same syntax in my shell is important

Re: Speeding up my ZSH shell

#70

As a long time Linux + bash user I switched to zsh three months ago when I was forced to use a Mac at a new job. In every previous job I was able to insist on Linux, but this one is very corporate. I decided not to fight it, except to install AltTab, Karabiner, Rectangle and a script that detects which screen my mouse is on so I can alt-tab through ALL the stuff on that screen (sane XFCE / KDE behaviour). I can't get…

Pure zsh is alright, it's pretty much just bash with fantastic autocomplete that usually provides short form documentation right there along with the options. So no need to remember (or look up) what -X -d -f stands for. Get rid of oh-my-zsh and give the proper shell another chance.

I actually like bash's autocomplete better (maybe there's a way to configure how zsh does it, I haven't looked into it).
Post reply on HN