Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Slow highlighting (Re: "drop-in replacement" and transpose-words-match)
- X-seq: zsh-workers 37936
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Slow highlighting (Re: "drop-in replacement" and transpose-words-match)
- Date: Wed, 10 Feb 2016 17:32:48 +0100
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=AV+5JhLbtj3LwpbzUMIuops7E9rkqyKjJoldZGXEuB4=; b=i66btrGyD1wE1TeJnLwpZ2bqOb6qCcQbvUo+5yDam8Z9rqz0Kwa4RqOMnmARb0qpKo A8JunBVQe4GsJq2srnktFmHanJvQYSTcDBf7fCTEDc2GOmlNt5zWr0vqkn/k87NUmxEV 4M5Un6LA36XLtnJJsj6m7RSfbHAs1CqLsE39mjk4BtYw2mEEK13dOahbRUl3yJByvGSS ki++eLd3kg5m2Y7W0czaQ+qGgz6oGy/fB8Y9r1ldjtXaiZrO1Y+/EZA7lS2HjBZuh78d JyeJ0HEpYO5bBeyINMRzzzx/T0dhVLOC4KqiXLx5kgVKRgQx4nxuYEGCBV8Xk2g/sS0J NRbA==
- In-reply-to: <160123222057.ZM16192@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- 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>
On 24 January 2016 at 07:20, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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"? What about with a history
> line containing a function definition?
Isn't it that zsyh does a fork for each token it analyzes?
# NOTE: This runs 'setopt', but that should be safe since it'll only ever be
# called inside a $(...) subshell, so the effects will be local.
_zsh_highlight_main__type() {
if (( $#options_to_set )); then
setopt $options_to_set;
fi
LC_ALL=C builtin type -w -- $1 2>/dev/null
}
...
local res="$(_zsh_highlight_main__type ${expanded_arg})"
...
case $res in
*': reserved') style=$ZSH_HIGHLIGHT_STYLES[reserved-word];;
*': suffix alias')
style=$ZSH_HIGHLIGHT_STYLES[suffix-alias]
;;
*': alias') () {
...
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author