From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23021 invoked by alias); 27 May 2015 22:15:51 -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: 35310 Received: (qmail 171 invoked from network); 27 May 2015 22:15:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1432764610; bh=0Alwu20XWswuiJ++zJ/0FSWTYzHmeHE6tdmrt3M1nS8=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=uWyGlpl+ufS5W4h91e9oMdyIzJJEYctKUsGJro+BXvECjza4U2khjYWurLKPudyxEQbHScHYtmJ6pJpxKHxM52cRDCE7vai7Tpy30VQ7DVwkKB3X2H0c8lCTeYnfqNwo/tNTgFYpfXbO1Yc1ZQSJ755cUdwJyKH/T8Dt6QyurKWU2vVfr1/btl38MJ68MMgTHyp8IJqaxqge3DbHOpnbEDbylVFNTgkJ+cy5uPcnsVMRTSzxI6dnojKkibDf5Hao03lMBYtowRJC8Z6khuUV+3W+3lv4u0lyLkpI4f1Ugc90hPOFhlUtSD/r4XKIrg/Nhg65TQXhXguzWROKrngREQ== X-Yahoo-Newman-Id: 30654.35811.bm@smtp116.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Rib3OtYVM1nq2gUxa7EbCVHacpTQ7vLTNHBi4Jqd4EJbVpo IOcCVnU4_W_7J48ssyUwMSA_GdVyzfUsMd5XtosSgNnNgIo4hB8ZZBr_EaNJ 5bSVkvvlovkGpxGeKLKsDc0xx7M6JUl0y_7TavxSbkbM64rwX7C5TaAJ6GQY GG_WW4DV3G3WIB.EABEHnk2dRnsDCP8EUc4dsR.jvcBiwWmmw4gH8Sh9glnX ez2XOb0YZ91a9Cv5eiQgvQnEEjHcuf540qY1cuMw_trN0UmyMP4xwstPgDcu 5sFEo2hMMOz5xCTNzgjtTiz33BCAJCRMBIwwRJbIBax8_aY0I7ByXGWnYaIv woq3vEQ2YjxmjotpT.ZjyhZinG45huF6mXMJLWgxDdsAhJVF2ptgw7TN1.zP LHnAwRanIxGXIgFBvYNWfdTIPGUlnXblP69WEnDfW5VzTxAEQQ1er61aLvhH aerSMe3M_9OkT47xFJiIqTogPTJrlqohBbWTfrM.VS78t0q7jyKDUtB9Bgo6 eTMOH5f6w4aXpyPbvquFkYBqorFYXeioB X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <150208122744.ZM5447@torch.brasslantern.com> From: Oliver Kiddle References: <54D78CA8.7010802@thequod.de> <150208122744.ZM5447@torch.brasslantern.com> To: "Zsh Hackers' List" Subject: Re: Performance of _store_cache and _retrieve_cache MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13333.1432764608.1@thecus.kiddle.eu> Date: Thu, 28 May 2015 00:10:08 +0200 Message-ID: <13334.1432764608@thecus.kiddle.eu> On 8 Feb, Bart wrote: > _zsh_all_pkgs=( "${(zQ)$(<<\EO:_zsh_all_pkgs > '02exercicio' '0x10c-asm' ... > EO:_zsh_all_pkgs > )}" ) This is removing the quotes before doing the word splitting so breaks if there are values that need quoting. It works with another level of nesting as in the patch below. I timed some tests and this is still much faster than the original given a large enough array. For a good example of this failing, set the extra-verbose style and do command completion. Note that you'll only see problems when _command_descriptions is loaded from the cache. Oliver diff --git a/Completion/Base/Utility/_store_cache b/Completion/Base/Utility/_store_cache index 8feaee6..fb2ab32 100644 --- a/Completion/Base/Utility/_store_cache +++ b/Completion/Base/Utility/_store_cache @@ -49,10 +49,10 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then (*(association|array)*) # Dump the array as a here-document to reduce parsing overhead # when reloading the cache with "source" from _retrieve_cache - print -r "$var=( "'"${(zQ)$(<<\EO:'"$var" + print -r "$var=( "'${(Q)"${(z)$(<<\EO:'"$var" print -r "${(kv@Pqq)^^var}" print -r "EO:$var" - print -r ')}" )' + print -r ')}"} )' ;; (*) print -r "$var=${(Pqq)^^var}";; esac