zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zach Riggle <zachriggle@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
Date: Mon, 29 Nov 2021 20:11:45 -0800	[thread overview]
Message-ID: <CAH+w=7a8AMNot=DLO_EK8hS7zE1gsU-7_EsaDFVTk9kgJSDLVA@mail.gmail.com> (raw)
In-Reply-To: <CAMP9c5=nQS_cw19fuKhKMJAAVPwEr5oCNUiBDBCWBiPC1KioWw@mail.gmail.com>

On Mon, Nov 29, 2021 at 6:30 PM Zach Riggle <zachriggle@gmail.com> wrote:
>
> I would expect that the md5sum of a file is reasonably fast, and could be stored in the .zwc for sanity checking, instead of just the "newer than" check.

To what are you comparing that checksum?  It could tell you if the
.zwc file were corrupted, but not whether the file differs from all
the component files that were compiled into it.  Even if you could
somehow tell they were different, that doesn't answer the question of
whether the .zwc contains newer versions of any of those functions.
The .zwc does contain a check that it matches the parser version of
the shell that's trying to read it.

> I expect that I have more $fpath entries than usual, but the total number of autoloadable functions is much more.

That's exactly the point:  You're unlikely to ever execute most of
those functions, so storing an autoload entry for them is much more
space-efficient (and startup-time faster) than actually parsing and
storing the function definitions themselves.

> $ for d in $fpath; do n=$(ls $d/* | wc -l); echo "$n $d"; done | sort -nr | head -3

Good heavens, so many processes and pipes.

n=($^fpath(e^'n=($REPLY/*(N.)); reply=("$#n $REPLY")'^))
print -l ${${(On)n}[1,3]}


  reply	other threads:[~2021-11-30  4:13 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 [this message]
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

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='CAH+w=7a8AMNot=DLO_EK8hS7zE1gsU-7_EsaDFVTk9kgJSDLVA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zachriggle@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).