Zsh Mailing List Archive
Messages sorted by:
Re: Are completions in some way heavy?
- X-seq: zsh-users 21622
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Are completions in some way heavy?
- Date: Mon, 6 Jun 2016 21:28:57 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Fh4PyAUSeZoBtHiq9G1f5fJmSACsYkmoD1ucmU1YdvQ=; b=uyf0gwI+fvuzoDpcBA8eF2RFvzzcVGgPFSrzUER6ylBKZmej59YbzSqqWRbwCjaP92 DiKSjIyOJ99evjFcdqDRMbHtGeRRfxGyb00ogkP3efSrdY82LqDZjDgWRVmmrO3+tNGj 2rYbsJmALHJDT9q7odlrLn7YYZa7mSjmb0J5lRmsdaxrn69X6NduUcwaO0rxXQ89RAO7 wZqS3xN2AoLzql6pnumlFlW9aldOVGLNvkcwbhnP2LS27w+IHAwZLCR2r+P9KMazZXxQ k5YpUiHO9HDMYkT6MhUF5jpI89MOwlZ9bS14JYo/zIqKg4nJ/qf76BKpirZfhVP20aZO WMjg==
- In-reply-to: <160606090104.ZM11947@torch.brasslantern.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBnpkEnkWZb4yh9BgutbBgfKS0Hh1x6e_Q-jnOyVDHQOg@mail.gmail.com> <160606090104.ZM11947@torch.brasslantern.com>
On 6 June 2016 at 18:01, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jun 6, 2:43pm, Sebastian Gniazdowski wrote:
> } This should provide speed up, to start with 15 enabled completions,
> } instead of 800 [...]
> } That's a failure but I thought that maybe shell will be much lighter
> } with <100 completions pre-loaded? Maybe situation with compsys isn't
> } that bright because of the number of _* files? How can I reveal
> } effects of much lighter $functions, etc., is it possible?
> Functions that are marked for autoloading but haven't yet loaded are
> already very lightweight. That was one reason for using a suite of
> files, so the autoload mechanism could take care of ignoring those
> that are never needed in a particular session. Then compdump avoids
> the overhead of scanning directories to find those files.
The autoloading mechanism is indeed nice. The same for the compdump.
What's also nice is how easy it was to detach all completions from
Zsh. Simple copy of all "_*" files. And instant working when placed in
other directory that's in $fpath.
> Making it the user's responsibility to explicitly choose what to enable
> is exactly what we wanted to *avoid*. If that's a requirement in order
> for the system to be "light enough" then we have failed.
I in general don't like completions, must admit. They often interfere
with what I want to do. Giving examples is much hard, such unpleasant
situations don't stick in memory. Maybe su. It completes fancy user
names on OS X . But ok, that's an acceptable must maybe (couldn't it
choose usernames with uid > 500 or something..?). But it doesn't
complete user names when invoked as "su - <TAB>". I guess patience is
needed for completions. They're like small man pages that disturb
view. One has to keep calm and try to read. Then it's fine.
There are orders in magnitude of quality in such tasks like
completion. This recalls me the various bootable CDs like Trinity,
Hiren's, Falcon, etc. How much effort can man put in making such
things better and better, more automated and robust? But only a few
people love doing such perfect things. The amount of work that I think
is needed for completions to cross next order of the magnitude would
require rapid iterations I guess, that's why I mentioned it. And I
wouldn't mind if I could disable and enable before that boundary is
crossed. But it's fine, completions are in general good. And there
undoubtedly is progress. Sometimes weird, like on Ubuntu where
kill<TAB> invokes fzf. Don't like the software because they did
history Ctrl-R via a hack: they don't parse multi-line entries,
instead they pass history event numbers together with one-line-packed
history entries, and then invoke vi-fetch-history:
I ended up with 240 "crucial" completions when selecting what to keep
by default. But it was in 30% a hard decision process. 70% of what has
been rejected was easy. But uncertainty stays. Also, zplg cenable
takes completion's file name without _. This can of course not match
command name. Guess I could enable all multiple-argument compdefs by
default. grep "compdef [a-z]\+ [a-z]\+" * | wc -l says there are 172
such completions. What's the point currently? Having plugin manager
part-free. The 50-80ms is quite significant when compared to 250ms
when Zplugins loads 9 plugins with full shadowing, reporting,
including heavy plugins like z-sy-h and autosuggestions (70 ms in
"light" mode without reporting). But on other hand, what's really fun
is having completions detached from Zsh.
> } Also, overall, it would be nice that I would collect all mainstream _*
> } patches, and provide the completions for all Zsh versions.
> Having a location from which to grab .../share/$ZSH_VERSION/functions/
> trees for past zsh releases would be useful, particularly if fixes from
> more recent versions were backported when possible.
> I would not suggest attempting to create forward-portable versions of
> the functions.
Messages sorted by: