From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Performance of _store_cache and _retrieve_cache
Date: Sun, 08 Feb 2015 17:19:52 +0100 [thread overview]
Message-ID: <54D78CA8.7010802@thequod.de> (raw)
-----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-----
next reply other threads:[~2015-02-08 16:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-08 16:19 Daniel Hahler [this message]
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
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=54D78CA8.7010802@thequod.de \
--to=genml+zsh-workers@thequod.de \
--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).