Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Optimizer for zwc digest files. B. Viewer for zwc files
- X-seq: zsh-workers 41404
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Optimizer for zwc digest files. B. Viewer for zwc files
- Date: Sat, 8 Jul 2017 12:29:36 +0200
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I have a super cool technique – extraction of functions from scripts. Currently, for 13 plugins that I use, I have automatically extracted that much functions:
ls ~/.zplugin/lexicon | wc -l
55
So, a lexicon of functions, compiled to `lexicon.zwc` digest, loaded with `autoload -w lexicon.zwc`.
B. Has anyone a word-code viewer, that would output op-codes, strings?
A. I need to optimize such digest-zwc. The optimization can target specific functions, not necessarily all possible variants.
With OS X "Instruments" (profiling tool), I have established that in general, CPU time is spend mostly in prefork(), addvars(), stringsubst().
Can word-code be modified (in second pass after zcompile), so that prefork(), addvars(), etc. are called less often? Maybe it's about doing more at compile time, less at run time? If I gain 20 ms, then I'll aprove lexicon.zwc into Zplugin.
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author