zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: Performance of _store_cache and _retrieve_cache
Date: Sun, 08 Feb 2015 11:14:08 -0800	[thread overview]
Message-ID: <150208111408.ZM5162@torch.brasslantern.com> (raw)
In-Reply-To: <54D78CA8.7010802@thequod.de>

On Feb 8,  5:19pm, Daniel Hahler wrote:
} Subject: Performance of _store_cache and _retrieve_cache
} 
} I've noticed that the completion systems cache mechanism
} (_retrieve_cache and _store_cache) is slow with large lists (~50000).

[...]

} The problem is that `source ./pip_allpkgs.slow` takes about 8 seconds,
} and is slower than generating the list anew!

This might be addressed by having a policy check at _store_cache time as
well as at _retrieve_cache.  (Check a different policy, that is.)

I've been wondering whether the cache mechanism should use zstyle
rather than the parameter space.  Unfortunately the current interface
encourages this type of thing:

  if ( [[ ${+_zypp_all_raw} -eq 0 ]] || _cache_invalid ZYPPER_ALL_RAW ) &&
     ! _retrieve_cache ZYPPER_ALL_RAW;
  then

or

  if [[ -n $state ]] && (( ! $+_svn_cmds )); then
    typeset -gHA _svn_cmds
    if _cache_invalid svn-cmds || ! _retrieve_cache svn-cmds; then

I.e., the caller is aware that the cache is stored in a variable and
therefore explicitly tests the variable as well as _cache_invalid.
That makes it a little difficult to change the backend.

Further the _cache_invalid tests there are actually redundant, it'll be
called again by _retrieve_cache.  So there's a bunch of cleanup to be
done in the use cases before the backend could be altered.

-- 
Barton E. Schaefer


  parent reply	other threads:[~2015-02-08 19:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 16:19 Daniel Hahler
2015-02-08 18:27 ` Daniel Hahler
2015-02-08 19:14 ` Bart Schaefer [this message]
2015-02-08 20:27 ` Bart Schaefer
2015-02-09  2:20   ` Slow parsing of large array assignments Bart Schaefer
2015-05-23  1:10   ` Regression with completion cache (was: Re: Performance of _store_cache and _retrieve_cache) Daniel Hahler
2015-05-27 22:10   ` Performance of _store_cache and _retrieve_cache Oliver Kiddle
2015-05-28 22:18     ` Bart Schaefer
2015-05-29 11:13       ` Peter Stephenson

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=150208111408.ZM5162@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@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).