From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.dk
Subject: Re: completion tricks
Date: Wed, 21 Mar 2001 09:23:58 +0100 (MET) [thread overview]
Message-ID: <200103210823.JAA19206@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Adam Spiers's message of Tue, 20 Mar 2001 17:00:33 +0000
Adam Spiers wrote:
> ...
>
> That's very instructive; thanks. Why .zdump not .zcompdump?
As I said, I (now) use 4.0.1-pre2 as my normal shell -- that uses
~/.zdump. But in at least one terminal I'm always running the latest
development version for testing -- that uses the normal ~/.zcompdump
which makes it easier with `zsh -f' and things like that. And I can't
use one dump file for both, because functions may change...
> ...
>
> > > Also, for this to work, wouldn't I have to include ~/.zsh/comp.zwc in
> > > fpath?
> >
> > Right.
>
> OK. Presumably it has to come before the normal Completion/* paths?
> I find the ELEMENT.zwc bit of the manual pretty hard to understand.
>
> When I put it at the head of fpath, memory consumption appears to
> grow from:
>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> adams 1421 0.2 0.7 3092 2052 pts/12 S 16:48 0:00 ..../zsh
>
> to:
>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> adams 1617 8.0 0.8 3772 2172 pts/3 S 16:50 0:00 ..../zsh
>
> Why's that? Startup time is better though, as expected.
That's because the shell has to map the `directory' contained in the
digest file (i.e. the list of function names whose definitions are in
the digest). Also, your OS may choose to map more pages than are
actually used. If the digest file is at the end of $fpath, the shell
will first find the definition file, load the function from it and
never touch the digest -- which may result in slightly lower memory
consumption at the beginning. However, as soon as there is a second
zsh running using the digest file will occupy less memory because the
second shell shares the mapped digest. Given the different memory
mapping policies one probably can't predict which way to load
functions looks better at the beginning.
> ... [ giving tips about performance in the docs ]
>
> Sounds good. So far, we have already mentioned _approximate and
> _correct (I still haven't got round to figuring out the difference
> between the two), and match specs. Some completions used to be really
> expensive, e.g. _perl_modules, _man, and _rpm, but hopefully the
> caching helps a lot with that. (Incidentally there are some rough
> edges with the caching mechanism which I *still* haven't got round to
> smoothing.) Anything else?
_cvs. I'm not sure if we should mention normal completion functions --
it could make some people not use the system even if their hardware is
very well capable of supporting the completion system.
Bye
Sven
P.S.: _approximate = _correct + _complete. One could say that
_approximate expects missing characters at the end of the word
(and doesn't count them as errors), while _correct thinks that
the word on the line is thought to be correct -- and checks if
it is.
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2001-03-21 8:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-21 8:23 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-03-20 15:36 Sven Wischnowsky
2001-03-20 17:00 ` Adam Spiers
2001-03-20 9:54 Sven Wischnowsky
2001-03-20 8:30 Felix Rosencrantz
2001-03-19 20:14 Jeff Shipman
2001-03-19 20:15 ` Marius Strom
2001-03-19 21:30 ` Adam Spiers
2001-03-19 21:46 ` Matt Armstrong
2001-03-19 22:04 ` Adam Spiers
2001-03-19 22:25 ` Matt Armstrong
2001-03-19 23:06 ` Adam Spiers
2001-03-20 8:28 ` Sven Wischnowsky
2001-03-20 8:37 ` Bart Schaefer
2001-03-20 14:57 ` Adam Spiers
2001-03-19 20:47 ` Stephane Bortzmeyer
2001-03-20 14:41 ` Stephane Bortzmeyer
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=200103210823.JAA19206@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-users@sunsite.dk \
/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).