zsh-users
 help / color / mirror / code / Atom feed
From: Zach Riggle <zachriggle@gmail.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: Mikael Magnusson <mikachu@gmail.com>, Zsh Users <zsh-users@zsh.org>
Subject: Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
Date: Tue, 30 Nov 2021 05:49:31 -0600	[thread overview]
Message-ID: <CAMP9c5kuUtuPO=JjefwEWU_gTxLs4vN7cvqxyZNMC3e6J+ESLA@mail.gmail.com> (raw)
In-Reply-To: <CAN=4vMrtOSV=74aWCitE1uYTq8GwyQrrvm6+ALMpMGy7gEPTNQ@mail.gmail.com>

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

> FWIW, I zcompile my own rc files

What is the optimal way to compile a huge set of them?  I've read Section
17 on zcompile, and it mentions "digest" files -- multiple files,
containing named functions, where the .zwc is added to $fpath instead of
the directory containing it.

It's trivial to set up an inotify watcher (Linux) or similar for other OSes
("brew install fswatch" seems to do fine on macOS) and recompile an entire
tree on-modify.  What I'm not aware of is any way to map dependencies
between various scripts (e.g. "source A" → "source B" → "source C") such
that when B changes, all of A/B/C get recompiled.  In fact, due to the
"source" keyword and Zsh internals, I'm not actually sure if it's even
necessary or beneficial.

*Zach Riggle*


On Tue, Nov 30, 2021 at 3:12 AM Roman Perepelitsa <
roman.perepelitsa@gmail.com> wrote:

> On Tue, Nov 30, 2021 at 9:27 AM Mikael Magnusson <mikachu@gmail.com>
> wrote:
> >
> > It would be very useful to have an option to benchmark normal
> > interactive shells instead of login shells
>
> Sounds useful indeed. I added `--login no` (the default is yes).
>
> > Also, you recommend against zcompiling .zshrc in your document, but
> > first_command_lag_ms=56.709
> > first_prompt_lag_ms=42.367
> > exit_time_ms=40.885
> >
> > Increasing startup time by 33% seems like a bad tradeoff to me, then
> > again, I know exactly how things work and am not likely to make the
> > mistake you mention.
>
> In the document I recommend that publishers of zsh configuration
> frameworks (think ohmyzsh, etc.) not zcompile user rc files by
> default.
>
> FWIW, I zcompile my own rc files, although I do it in a way that
> avoids issues caused by mtime and missing source files (I don't
> mention the latter problem in the doc; basically, if you zcompile an
> rc file and remove the source, the rc file will still be in effect).
> The only downside I get from zcompiling is that aliases get expanded
> differently but that's fine with me.
>
>

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

  reply	other threads:[~2021-11-30 11:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27  8:10 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMP9c5kuUtuPO=JjefwEWU_gTxLs4vN7cvqxyZNMC3e6J+ESLA@mail.gmail.com' \
    --to=zachriggle@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).