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

Optimizer for zwc digest files. B. Viewer for zwc files

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 

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