zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Optimizing (z)-flag
Date: Sun, 11 Aug 2019 21:20:11 +0200	[thread overview]
Message-ID: <CAKc7PVC+omzigM3Di58zKJE+h5f6gf9xKc09pSmQ940k0j_JFA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7ZMSwpD6-c43Q-80oRM7qkQahOJ1VFpm8h+mFkXRwB4rg@mail.gmail.com>

On Sun, 11 Aug 2019 at 20:37, Bart Schaefer <schaefer@brasslantern.com> 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

      reply	other threads:[~2019-08-11 19:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-11 18:20 Sebastian Gniazdowski
2019-08-11 18:37 ` Bart Schaefer
2019-08-11 19:20   ` Sebastian Gniazdowski [this message]

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=CAKc7PVC+omzigM3Di58zKJE+h5f6gf9xKc09pSmQ940k0j_JFA@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=schaefer@brasslantern.com \
    --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).