From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20298 invoked by alias); 10 Feb 2016 18:18:40 -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: 37940 Received: (qmail 4759 invoked from network); 10 Feb 2016 18:18:39 -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,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=h3P8mBUz8z5P/mgVS0tzDn7+G3viPeKG7lBD5qsOyYA=; b=oftQKDhlcqIprUJxrtbnDqcHZi3pM9LUiama/i8UBJ05SaM/F9bsdTDt7FxX78MuXk nX+uhzHpYr/2Lr1E8r7IvLXU5ghhaz6KsXA5Jhk8RxvUlze345Ux8ftwnelh9e6Fi2aD Vc+qpefSXFihPykhALlmeVMWn1nbMiR0C/HEgnkDNS2O9T5SP4zh8ULgeiLwCjovDfOJ V5XoxWqNv7gTR0lJb8rCkJrv1igrVSpP/qAIH3aCEotavTZ4pyQT5dQnCxPDfhfdbe/i TiLwswqGM6Ltrk7x+q533hYnOlkbweEZpgbi0/Ba39yIUwRkWXuPrdkD9QBpDtwEz6UD 1vdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=h3P8mBUz8z5P/mgVS0tzDn7+G3viPeKG7lBD5qsOyYA=; b=PJV5wA4OjQzs3Gsi0MrThPU6L12sfCaoymgdA/QYBqTuNTZ2qHft9jqmBRJTJ106Ue w5XojuY/HLjBBRMGQbH93SONw5JHOxsD96HttGQ61GXUECPw/Cc83EDm29olL0Edz8Cf s2uRNtI3NTvHMsSUtvGkEcryQcLZ4i+/0x7UubR5wS1os45GZZL5azBQ7cnDMtfOBjoG 4gpbx1DLNvy4harCKSUDjFd/mwYAwJPanUnFhLJ+j/5Wi3uclfIJvSZC6971Q5tobgTa X5Ec5Eh7L97mc7j2kcgT8vDQ6q3jxeqgcQduO4gqYjWc7zaD5i99zXhWH5thSE44iCri s21A== X-Gm-Message-State: AG10YORhhRAApeLIIM5Wki4fFfa6mUKmZGxMAPVgyMNoTZDw6bmtk+JNIBNSk03pxs1U2Q== X-Received: by 10.67.7.129 with SMTP id dc1mr45385865pad.87.1455128316789; Wed, 10 Feb 2016 10:18:36 -0800 (PST) From: Bart Schaefer Message-Id: <160210101846.ZM2333@torch.brasslantern.com> Date: Wed, 10 Feb 2016 10:18:46 -0800 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Slow highlighting (Re: "drop-in replacement" and transpose-words-match)" (Feb 10, 5:32pm) 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> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: Slow highlighting (Re: "drop-in replacement" and transpose-words-match) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 10, 5:32pm, Sebastian Gniazdowski wrote: } } Isn't it that zsyh does a fork for each token it analyzes? _zsh_highlight_main__type does appear to be called slightly more often than once per line on a sample function body. However it doesn't take much time: 1.602947000e+00 local res="$(_zsh_highlight_main__type ${expanded_arg})" 1.603546000e+00 _zsh_highlight_main__type ${expanded_arg} 1.603900000e+00 if (( $#options_to_set )) ; then ; setopt $options_to_set ; fi 1.603988000e+00 (( $#options_to_set )) 1.604063000e+00 LC_ALL=C builtin type -w -- $1 2> /dev/null 1.604682000e+00 That's 0.001735 seconds per call on my system. Not enough to account by itself for the noticeable delay, I think. It's true that most of that time is managing the fork -- each call could be be 0.0012 or so faster without forking -- but I'd still be surprised if that clears it all up.