Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.0
Date: Tue, 26 Jan 2016 22:50:08 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Slow highlighting (Re: "drop-in replacement" and
 transpose-words-match)
Message-ID: <20160126225008.GB4731@tarsus.local2>
References: <160111233259.ZM6719@torch.brasslantern.com>
 <CAKc7PVDhxbVgmV7WcGgyDzMmWSjwQ=7=LExXTwr7YvPzPpn2RA@mail.gmail.com>
 <160118223126.ZM28565@torch.brasslantern.com>
 <CAKc7PVB-X+DYVEHRqSoOiDAjNeTsVyz=EN72FHQuF=AnRmh65A@mail.gmail.com>
 <160119195608.ZM31931@torch.brasslantern.com>
 <20160123235303.GE20278@tarsus.local2>
 <160123222057.ZM16192@torch.brasslantern.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <160123222057.ZM16192@torch.brasslantern.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 37798

Bart Schaefer wrote on Sat, Jan 23, 2016 at 22:20:57 -0800:
> On Jan 23, 11:53pm, Daniel Shahaf wrote:
> } [Re-analyzing on every keystroke] doesn't explain the slowness on
> } fned buffers: the initial highlight of an fned buffer involves exactly
> } one _zsh_highlight call, and yet is slow.
> 
> Is it similarly slow on any use of "vared"?

fned with z-sy-h is slow.

fned without z-sy-h is fast.

vared with z-sy-h is slow.

I tested this with
.
    autoload +X vcs_info
    autoload zed
    zed -f vcs_info
.
compared to
.
    autoload +X vcs_info
    s=$(which vcs_info); vared s
.
.

> What about with a history line containing a function definition?

Also slow.  Tested with:

    # Copy the function's definition to the clipboard, then paste it back
    autoload +X vcs_info
    which vcs_info | xsel
    <shift+insert>

I also tested it as a single line, and that was still slow:

    autoload +X vcs_info
    which vcs_info | perl -pe 's/\n/;/' | xsel
    <shift+insert>

Thanks for the help!

Daniel

