From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator Date: Mon, 27 Nov 2023 14:10:53 +0200 Message-ID: <83bkbf9z1u.fsf@gnu.org> References: <87a5r5ph3p.fsf@bernoul.li> <87msv2vmzf.fsf@bernoul.li> <878r6mzezo.fsf@ushin.org> <87sf4tg6ts.fsf@bernoul.li> <875y1po3nk.fsf@ushin.org> <871qccqmgi.fsf@ushin.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38646"; mail-complaints-to="usenet@ciao.gmane.io" Cc: joseph@ushin.org, 67390@debbugs.gnu.org, jonas@bernoul.li, adam@alphapapa.net To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 27 13:12:07 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1r7aT9-0009sD-2D for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Nov 2023 13:12:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7aSz-0003yi-W3; Mon, 27 Nov 2023 07:11:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7aSx-0003y5-VB for bug-gnu-emacs@gnu.org; Mon, 27 Nov 2023 07:11:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7aSx-00041y-Ge for bug-gnu-emacs@gnu.org; Mon, 27 Nov 2023 07:11:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r7aT3-0003EO-MW for bug-gnu-emacs@gnu.org; Mon, 27 Nov 2023 07:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Nov 2023 12:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67390 X-GNU-PR-Package: emacs Original-Received: via spool by 67390-submit@debbugs.gnu.org id=B67390.170108708812367 (code B ref 67390); Mon, 27 Nov 2023 12:12:01 +0000 Original-Received: (at 67390) by debbugs.gnu.org; 27 Nov 2023 12:11:28 +0000 Original-Received: from localhost ([127.0.0.1]:43408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7aSW-0003DO-2R for submit@debbugs.gnu.org; Mon, 27 Nov 2023 07:11:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7aSR-0003D9-3i for 67390@debbugs.gnu.org; Mon, 27 Nov 2023 07:11:26 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7aSD-0003oo-HQ; Mon, 27 Nov 2023 07:11:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=fLXy3cDTN7IaNAiZ5JQMlSXRiUtPJUFyaTJg/A7HKVU=; b=ba1QWSlpVzeALWkNwZkP DJwLFy8haS7wNz/N7oaldX/d4eokEHML5CwhP7fJ8FpFCKusSaosQkLh6BZExwKClIGwcVhpJhF8k yl/5lgOox+LagJlgwEOgeABRCD+ZJGReL1zhJzQazt4I9XMZVg6ee5C/m7uvr0bTeROOVunh6vvlI 9pUbAXwjYjIMFSkpOn/Sam4paZhIBJmbSeCzupfsKRpI2EtaQ39EGARxP2qq7hKkhOwfTxaAK5TGx /EkPea/QBz5D7/G+YzMojTaE+x14G1fWh3U26DQAOq6F+HU6npOOauCFORuxAuraBGsuopT1K4FsR 43woQccWrSetGg==; In-Reply-To: (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Sun, 26 Nov 2023 22:02:01 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275114 Archived-At: > From: João Távora > Date: Sun, 26 Nov 2023 22:02:01 +0000 > Cc: Jonas Bernoulli , 67390@debbugs.gnu.org, > Adam Porter > > On Sun, Nov 26, 2023 at 8:38 PM Joseph Turner wrote: > > > > João Távora writes: > > > > > On Sat, Nov 25, 2023 at 10:43 PM Joseph Turner wrote: > > > > So, benchmarking it will have to be, I'm afraid, because AFAIK > > > font-locking is a very performance sensitive area of Emacs. > > > > Yes. I would like to learn how to do this! > > I'm CCing Eli. > > In the past, ISTR, Eli suggested to benchmark such things by visiting a > very large file in its beginning, then scrolling down by holding > the down arrow or PgDn for some fixed time period, like 30 seconds. > The Emacs that scrolls the farthest is the most performant. Not > entirely fail-proof (other processes may interfere, etc), but not > bad either. I still recommend this method. Something like the below: (defun scroll-up-benchmark () (interactive) (let ((oldgc gcs-done) (oldtime (float-time))) (condition-case nil (while t (scroll-up) (redisplay)) (error (message "GCs: %d Elapsed time: %f seconds" (- gcs-done oldgc) (- (float-time) oldtime)))))) Evaluate the above, and the invoke it at the beginning of a large file. Then compare the timings with different font-lock arrangements. A variant is to scroll by N lines, not by pages. Just change the above to call scroll-up with the argument of N, for example 1 (or any other number, if you want).