Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: slow startup of zsh (1x slower than bash)



On Fri, Sep 6, 2019 at 2:57 PM Peng Yu <pengyu.ut@xxxxxxxxx> wrote:
>>
>>
>> Perhaps you can change your code to spawn fewer zsh processes?
>
>
> But because zsh is much slower than bash...

This isn't a fair summary of your benchmark. It would be more accurate
to say that zsh on some systems may take up to twice as long as bash
to execute an empty script.

> Only if it is faster than bash, I may consider using it.

Could you share some details of your environment in which the overhead
of 6.7 ms per script is OK but 12 ms is not?

When running a script interactively, this difference shouldn't matter.
12 ms is practically zero as far as human perception is concerned.
When running lots and lots of scripts in a tight loop, then it's
usually better to change your code to avoid spawning so many shell
processes. In zsh autoloading functions is often a good solution, but
the particular code changes will depend on what your code looks like
so that it results in so many shell processes.

Roman.



Messages sorted by: Reverse Date, Date, Thread, Author