zsh-workers
 help / color / mirror / code / Atom feed
* Caching between matchers
@ 2001-12-08 15:07 Borsenkow Andrej
  2001-12-08 17:51 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Borsenkow Andrej @ 2001-12-08 15:07 UTC (permalink / raw)
  To: Zsh hackers list

When completion generates list of matche on-the-fly (like installed RPMs
or list of available RPMs in urpmi completion) it currently does it for
every matcher that is tried. If list is long (urpmi has ~3000 packages
in database) or needs some time to build (esp. when forking off) it may
take quite a bit of time.

Because the list obviously is not changed between matchers, is it
possible to reuse it?

Actually, is it possible to traverse matchers list internally in
compadd? This way we'd have just one list that would be checked against
matchers. I am not sure what drawbacks it have though.

-andrej



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

* Re: Caching between matchers
  2001-12-08 15:07 Caching between matchers Borsenkow Andrej
@ 2001-12-08 17:51 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2001-12-08 17:51 UTC (permalink / raw)
  To: Borsenkow Andrej, Zsh hackers list

On Dec 8,  6:07pm, Borsenkow Andrej wrote:
} Subject: Caching between matchers
}
} When completion generates list of matche on-the-fly (like installed RPMs
} or list of available RPMs in urpmi completion) it currently does it for
} every matcher that is tried. If list is long (urpmi has ~3000 packages
} in database) or needs some time to build (esp. when forking off) it may
} take quite a bit of time.

This is why the caching mechanism (_store_cache, _retrieve_cache, and
_cache_invalid) was introduced; _urpmi should be doing its own caching.

} Because the list obviously is not changed between matchers, is it
} possible to reuse it?

This isn't precisely true.  Many completers test $_matcher_num, which is
set by main complete, and do nothing if it is greater than 1.  On the
other hand, _path_files tests whether the *last* matcher is being tried,
and may add more path expansions to the list in that case.

} Actually, is it possible to traverse matchers list internally in
} compadd?

I don't think so, because the matchers may be traversed multiple times
(e.g.  the _prefix and _ignored completers re-traverse the matcher-list).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

end of thread, other threads:[~2001-12-08 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-08 15:07 Caching between matchers Borsenkow Andrej
2001-12-08 17:51 ` Bart Schaefer

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).