zsh-users
 help / color / mirror / code / Atom feed
* Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
@ 2021-11-27  8:10 Zach Riggle
  2021-11-27  8:33 ` Roman Perepelitsa
  0 siblings, 1 reply; 18+ messages in thread
From: Zach Riggle @ 2021-11-27  8:10 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

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*

[-- Attachment #2: Type: text/html, Size: 1304 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-11-30 16:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27  8:10 Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits Zach Riggle
2021-11-27  8:33 ` Roman Perepelitsa
2021-11-27 20:22   ` Bart Schaefer
2021-11-30  2:30     ` Zach Riggle
2021-11-30  4:11       ` Bart Schaefer
2021-11-30  8:18         ` Zach Riggle
2021-11-30  7:51       ` Roman Perepelitsa
2021-11-30  8:10         ` Mikael Magnusson
2021-11-30  8:27           ` Mikael Magnusson
2021-11-30  8:30             ` Zach Riggle
2021-11-30  9:11             ` Roman Perepelitsa
2021-11-30 11:49               ` Zach Riggle
2021-11-30 12:30                 ` Roman Perepelitsa
2021-11-30 15:10                   ` Zach Riggle
2021-11-30 16:37                     ` Bart Schaefer
2021-11-30 16:41                       ` Roman Perepelitsa
2021-11-30  8:29           ` Roman Perepelitsa
2021-11-30  8:25         ` Zach Riggle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).