zsh-workers
 help / color / mirror / code / Atom feed
* Performance of _store_cache and _retrieve_cache
@ 2015-02-08 16:19 Daniel Hahler
  2015-02-08 18:27 ` Daniel Hahler
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Daniel Hahler @ 2015-02-08 16:19 UTC (permalink / raw)
  To: Zsh Hackers' List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've noticed that the completion systems cache mechanism
(_retrieve_cache and _store_cache) is slow with large lists (~50000).

_store_cache saves the array like this:

    _zsh_all_pkgs=( '02exercicio' '0x10c-asm'  ... )

and _retrieve_cache then sources it from a file.

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


When converting the list to be line-separated, the following is much
faster (less than a second):

   _zsh_all_pkgs=(${(f)"$(<pip_allpkgs)"})

This also applies to using the "formatted"/"typed" source file as-is:
Even when using the slow list as is:

   _zsh_all_pkgs=(${$(<pip_allpkgs.slow)})


The initial list is generated using:

      _zsh_all_pkgs=( $(curl -s https://pypi.python.org/simple/ \
        | sed -n '/<a href/ s/.*>\([^<]\{1,\}\).*/\1/p' \
        | tr '\n' ' ') )


Regards,
Daniel.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iD8DBQFU14yofAK/hT/mPgARAkEFAKD2P5vOvKLwOQffWmq8OTTCTxFHTQCfQzzL
bqUGpSQvauen9qgus9FB5rQ=
=72Ab
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2015-05-29 11:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-08 16:19 Performance of _store_cache and _retrieve_cache Daniel Hahler
2015-02-08 18:27 ` Daniel Hahler
2015-02-08 19:14 ` Bart Schaefer
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

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