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

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



I've started playing with moving many of the functions I've declared in a script with most of my aliases, and migrating them to their own file in a directory contained by $fpath.

I'm not sure if this is overall a net performance gain to defer the various aliases / function-wrappers-as-aliases to autoloadable modules, but it seems fun.  Does anybody have information on which approach is faster?
  1. alias foo='foo --flag1 --flag2'
  2. foo() { command foo --flag1 --flag2 "$@" }
  3. autoloadable module containing (2)
Finally, I'm aware of the zcompile tool to create .zwc bytecode files, but it appears that this causes issues with $functions / $functions_source and sometimes things don't work.  

Is there a true performance benefit in the general case for pre-compiling ALL of my zsh scripts (i.e. everything inside ~/.zprezto that /usr/bin/file says is a "zsh script text executable")?  What are the benefits / trade-offs / caveats of doing this?

Zach Riggle



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