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

Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits



On Tue, Nov 30, 2021 at 7:10 AM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
>
> Fortunately, you can redefine "source" as a function and trap all calls and measure how long it takes to load each file.

If you redefine "source" as a function, then any "typeset" commands in
the sourced files take on the semantics of "local" and the parameters
are created only in the context of the function wrapper.  That may not
have any significant effect on benchmarking, but for example settings
from syntax-highlighting/init.zsh might not be visible to
syntax-highlighting/external/zsh-syntax-highlighting.zsh (if that
matters).

In any case you definitely don't want this in place outside of benchmarking.




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