From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bug-reference-prog-mode slows down CC Mode's scrolling by ~7% Date: Wed, 01 Sep 2021 16:59:02 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37681"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 01 22:59:47 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLXKl-0009Wt-7K for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Sep 2021 22:59:47 +0200 Original-Received: from localhost ([::1]:48998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLXKj-0000Lx-Rx for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Sep 2021 16:59:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLXK9-00081P-Uz for emacs-devel@gnu.org; Wed, 01 Sep 2021 16:59:09 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLXK7-0004Y0-07 for emacs-devel@gnu.org; Wed, 01 Sep 2021 16:59:08 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 51F7E10033F; Wed, 1 Sep 2021 16:59:05 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 34D0A1001F3; Wed, 1 Sep 2021 16:59:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1630529943; bh=pH61FHOL+s2GqhABexo8DoHIY321lpU6YaAMEFijxLY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=YpntDpFle8Uoeqme23p81i1MPpQdFYzMfOTgGu/xgZ6BaNbrXQsmbcn3Z76pYMq6G Tkfqq1FxBJC+/bs3WffNFdNvqgtvtZCCLXesh9u73CjtaG42g0VXnnOSbH4H4IlJgx 6gK9g9piTTfYPBlZ+yNEVjCRtCijsG2OcOALK4uFVWSIL7KuH0Q5+oB4pjBsBdHefM JsT/5gOvzzMO+JspxAx9EYktCnQXGJznly41q+j9eQUn9nPL/IUayHIA3b0T3A1b+x L1YYFpaLXwtrljKXRFo+SYaruFquGdEmX2vv4tA161BXDbMpIFUsq/1zx6ociGzXJy eoyt7onrV/Svg== Original-Received: from pastel (unknown [104.247.244.135]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0D5A2120396; Wed, 1 Sep 2021 16:59:03 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Wed, 1 Sep 2021 17:33:06 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:273685 Archived-At: > However, this mechanism is rendered ineffective if a second function is > add-hook'd onto jit-lock-functions. Maybe this could be fixed, though > it looks difficult. I think we can "easily" handle this specific case if the `bug-reference-prog-mode` function is added to the end of the hook rather than to its beginning and use a patch along the lines of the one below. I don't know if it would make any difference to the 7% figure. Stefan diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index a905936b6b9..14d09c979b9 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -390,7 +390,7 @@ jit-lock--run-functions 'jit-lock-functions (lambda (fun) (pcase-let* - ((res (funcall fun beg end)) + ((res (funcall fun (or tight-beg beg) (tight-end end))) (`(,this-beg . ,this-end) (if (eq (car-safe res) 'jit-lock-bounds) (cdr res) (cons beg end))))