DEV Community

Discussion on: A brief difference between zsh and bash

Collapse
 
yunielrc profile image
Yuniel • Edited

zsh faster than bash?

zsh/bash/dash

Collapse
 
jasmin profile image
Jasmin Virdi

I could sense the possible reason behind this might be the sourcing of a few other files in the .zshrc. Sometimes it is also because of the plugins which are unable to find the command. I suggest you should find the reason why it is taking a long time.
You can try the following steps, they might help you in detecting the root cause.

  1. To check the xtrace and verbose output you can try the command zsh -xv
  2. Second you can try an order-blind profiler which will enable built-in profiling. For this you need to add zmodload zsh/zprof and zprof at the top and bottom of your .zshrc file. This will tell you where zsh is taking more time.
  3. There can be few dependencies which slow down the shell's performance. For that, there is a great sandbox which will helps you to speed up the shell's performance in case this the culprit behind slowing down your shell.
Collapse
 
yunielrc profile image
Yuniel • Edited

Hi Jasmin, thanks for your reply, bash is faster than zsh in linux.

you can see the video below:
zsh vs bash performance in ubuntu 20.04 server

Thread Thread
 
jasmin profile image
Jasmin Virdi

Thanks for sharing the video!👍

Thread Thread
 
yunielrc profile image
Yuniel

A pleasure, have a nice day Jasmin