From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18975 invoked by alias); 8 Feb 2015 19:14:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34474 Received: (qmail 17763 invoked from network); 8 Feb 2015 19:14:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=CoYIqc8G c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=0HtSIViG9nkA:10 a=1ocUIIK1PD1w2xxfiJEA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <150208111408.ZM5162@torch.brasslantern.com> Date: Sun, 08 Feb 2015 11:14:08 -0800 In-reply-to: <54D78CA8.7010802@thequod.de> Comments: In reply to Daniel Hahler "Performance of _store_cache and _retrieve_cache" (Feb 8, 5:19pm) References: <54D78CA8.7010802@thequod.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: Performance of _store_cache and _retrieve_cache MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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