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

Performance of _store_cache and _retrieve_cache



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



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