From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21495 invoked by alias); 10 Feb 2016 16:33:12 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37936 Received: (qmail 2310 invoked from network); 10 Feb 2016 16:33:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=AV+5JhLbtj3LwpbzUMIuops7E9rkqyKjJoldZGXEuB4=; b=JfnrehCasAJ6JgbszCfuVh3yQW1uHXVic05aWGi8NotcfthtMDFljjO7QGYxUUPG97 ue8yYRmKfDtQNNG0NveekEfQfoh6iTuD0DpfRLJaU2LBQNOUOi3A494imrwxKu79/8Rz FRldwYutkB9JLO+SExSe6z7rQ3lVyDh16/b+rehI6WeG12HYvZYvqhI7fwq9gBIRRsO8 7K/0EewM7oU3TBdmv+uYrUwxv90tyhVIUR52dCPuHG02Mu82igbWP7cgIxEgKBvsiIB3 p9MLpc5MDEx0qCv1e+eLgDLQxE7EXZkD02K2OzUO67x8Dp+NtD58AcFURbt3ulLeHr1V HBwA== X-Gm-Message-State: AG10YOQyYsfH/hgPb2ccGJTeR4Bc+y7s2ju3AJovIN5MRAAw7Rz2AB/s8MLYFym8MZrPuI81aId7DtFtLc8rtA== X-Received: by 10.112.134.165 with SMTP id pl5mr16953255lbb.126.1455121988466; Wed, 10 Feb 2016 08:33:08 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <160123222057.ZM16192@torch.brasslantern.com> References: <160111233259.ZM6719@torch.brasslantern.com> <160118223126.ZM28565@torch.brasslantern.com> <160119195608.ZM31931@torch.brasslantern.com> <20160123235303.GE20278@tarsus.local2> <160123222057.ZM16192@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Wed, 10 Feb 2016 17:32:48 +0100 Message-ID: Subject: Re: Slow highlighting (Re: "drop-in replacement" and transpose-words-match) To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On 24 January 2016 at 07:20, Bart Schaefer 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