Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Use of caching with completions



I've been thinking a bit about whether caching of data relating to
completions is a good idea or not.  Obviously I'm talking about
completions of things like all man pages or installed rpms (or the
platform-equivalent) on the system, where calculation of a potentially
huge list is expensive.

Pros:

  - immediate response after the first completion for the rest of the
    life of the shell

Cons:

  - may make the environment huge (does this matter too much?)
  - duplication of (effort of calculating) data across multiple shells
  - need for manual forcing of recalculation if for example you
    install a new man page

Any others?

Would it be worth storing the data to a file so that recalculation
only takes place when the user says so?  After all, on many systems
the set of man pages (say) very rarely changes.

Would it be worth abstracting the caching layer, so that the user can
force recalculation of any particular data set through a standard
interface?  Or is this all stupidly overkill and should I just get a
life and deal with the n-second pause (where n is small) the first
time I complete man pages/rpm packages/Perl modules etc. etc. in a new
shell? :-)

Adam



Messages sorted by: Reverse Date, Date, Thread, Author