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

Re: autoload




Some first adventures with Bart's method. Proof of concept only, no checking yet.

The kosher method in .zshrc:

#autoload -U compinit && compinit -d $ZSHBOOT/zcompdump
#autoload -U colors && colors
#autoload -U select-word-style && select-word-style shell

... gives:

    $ time zsh -i -c exit  0.14s user 0.06s system 98% cpu 0.211 total

... now this, after having moved all asked for files into my private ZSHBOOT dir
and cooked them up with zcompile:

fpath=$ZSHBOOT
autoload -w $ZSHBOOT/zsh-boot.zwc
compinit -d $ZSHBOOT/zcompdump
colors
select-word-style shell

... my thinking being that functions which are certain to be called are a good place to
start experimenting.

... gives:

    $ time zsh -i -c exit  0.05s user 0.06s system 97% cpu 0.111 total

... so with just those three autoloads it's twice as fast, saving a whopping 1/10th of a second. All of it in the 'user' category, I don't know if that's significant. Most interesting anyway, and so far it seems to work, tho I'd not be astonished to hear that I've broken something. It might be DOSthink, but I like having everything I need to
fire up my zsh in one place thusly:

3 HP-w5--5-Debian1 /aWorking/Zsh/Boot 3$ l

Sorting All file types Backwards by Modification Time ():

drwxr-xr-x 2   4096 2015-09-11_12:03:21 Backup/
-rw-r--r-- 1   2934 2014-12-02_20:26:53 zbindkey
-rw-r--r-- 1   1371 2015-09-13_15:55:51 aliases
-rw-r--r-- 1   2375 2015-09-14_08:27:29 zstyle
-rw-r--r-- 1  11403 2015-09-15_19:51:07 zmv
-rw-r--r-- 1   2230 2015-09-15_19:51:07 select-word-style
-rw-r--r-- 1  16435 2015-09-15_19:51:07 compinit
-rw-r--r-- 1   3417 2015-09-15_19:51:07 colors
-rw-r--r-- 1   5667 2015-09-15_20:25:25 compaudit
-rw-r--r-- 1   4015 2015-09-15_20:25:25 compdump
-r--r--r-- 1  57984 2015-09-15_20:25:50 zsh-boot.zwc
-rw-r--r-- 1    484 2015-09-15_20:26:11 zcompdump
-rw-r--r-- 1   5464 2015-09-15_20:43:10 zshrc
-rw-r--r-- 1    878 2015-09-15_20:55:39 dirstack
-rw------- 1 441938 2015-09-15_20:55:41 histfile

... of course there's more needed stuff as well no doubt, but this at least gives me
a bit of focus, and fpath is a single directory :-)





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