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

Re: Optimizing (z)-flag



On Sun, 11 Aug 2019 at 20:37, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> You're going to want to look at bufferwords in Src/hist.c.  If memory
> allocation is the problem (of which I'm not convinced) it's probably
> ...

Yeah, it does things properly – via a linked list. So appends are
fast. At the end it converts the list into an array via:
            aval = hlinklist2array(list, 0);

which does things properly too. I'm not sure why I've had the
impression that (z) is somewhat slow, for a zshrc with 20001
characters it runs in:

( a=(${(z)buff}) ; )  0,00s user 0,00s system 83% cpu 0,005 total

which is a very good time. It was probably when I was optimizing
fast-syntax-highlighting and a time like 100 ms seemed large.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



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