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

Re: zcompile bug? zcompile on a single script setting up a chpwd function



On Wed, Oct 7, 2020 at 9:48 AM Doron Behar <doron.behar@xxxxxxxxx> wrote:
>
> The function `_chpwd_task_contexts_parser` defined in that file slows
> down the shell startup time, and I was looking for a way to improve the
> situation. I tried simply zcompiling it

zcompiling doesn't improve execution speed of functions. It can
benefit you only if parsing takes a long time. Given the small size of
file `taskwarrior` (3.5KB), parsing should be almost instantaneous (at
most 1ms), so the speedup from zcompiling won't be noticeable.

> I get on startup:
>
>         [3] 27780
>         /home/doron/.zsh/chpwd/taskwarrior.zwc:1: no such file or directory: ^G^F^E^D^A

Looks like taskwarrior.zwc is corrupted. My practical advice is to
simply remove this file and not waste time on zcompile as it won't
help you anyway. Slow shell startup is likely caused by the slow
execution of _chpwd_set_task_context. You'll need to either avoid
invoking this function or make it run faster.

Roman.




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