From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator Date: Wed, 29 Nov 2023 08:21:59 +0000 Message-ID: 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> <83bkbf9z1u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005587c3060b463bff" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19189"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joseph Turner , 67390@debbugs.gnu.org, Jonas Bernoulli , Adam Porter To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 29 09:23:16 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 1r8Fql-0004iJ-Sw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Nov 2023 09:23:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8FqT-0007oI-1f; Wed, 29 Nov 2023 03:22:57 -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 1r8FqR-0007no-GJ for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 03:22: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 1r8FqR-00010d-8h for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 03:22:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r8FqY-0006se-Hb for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 03:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Nov 2023 08:23:02 +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.170124614826403 (code B ref 67390); Wed, 29 Nov 2023 08:23:02 +0000 Original-Received: (at 67390) by debbugs.gnu.org; 29 Nov 2023 08:22:28 +0000 Original-Received: from localhost ([127.0.0.1]:48751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8Fq0-0006rn-0H for submit@debbugs.gnu.org; Wed, 29 Nov 2023 03:22:28 -0500 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:61817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8Fpw-0006rY-Rl for 67390@debbugs.gnu.org; Wed, 29 Nov 2023 03:22:26 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50bc7706520so187939e87.3 for <67390@debbugs.gnu.org>; Wed, 29 Nov 2023 00:22:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701246131; x=1701850931; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9SVIHpDNeA1YGHX3lHRPLIBTC5gijmfmsP5W19XFQK4=; b=WUC055ZQWRCnSj07qJ5QBNvEB//WACA8gqFaLvcDOS5fRWdYqpJbrY4POn+FT7lkPX 9RL+8Qr7rgbLknzRWAorVGVtuGjm+OuV0CsbkpOx1QtFP+E8uGNbANWqJvpFNPNOddMZ bXn2ZTBuzRsqD6+Q3QbsOzcQfSFdqb1ud1UiCA1leiHJGovmI0IKVuvZXjokhBZss6yN mkIKljQhiaZ2Hm5KpriMlcMHNwnkT9ad4AZZBPe/2Hieu9xxLCQBRfOCOC//vsqwzWfy SFnPJ31ygTI4G9N4/75D8dcXMAHOIqiZOIRfGsv2IRWVG67QqoWJ0of+SOtQrJbwrgbW OxQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701246131; x=1701850931; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9SVIHpDNeA1YGHX3lHRPLIBTC5gijmfmsP5W19XFQK4=; b=YUrfG6VetoHsPCc74etI1QcMlz0PIaXwA9AOlPDvKudAdeOWb5T7tGtzerLU+yAMbR cGVjvSVJDVacmObBFesFvmjsJArVOR1tP49LG2Dmq3/bY6GE2vKUU3MwYatvMhSWcQ1k o7hOQbxINkW4QVBzFmJNHzqZj2Qt22WahhBwURZ/xpg1KdnaZMtEyTF3uwUCr99Wrcsx Pb8AcqKA2OPTotzTGYGm/rUBnffx1a3O2SZx6SocTK5laqCF7CvvPO+XcbZIV56fLo6w OtTMGI+Ak2w+PgqotoBpOwE+FcAwsoXQdAN6FWa2w9U9nV51RMy67+dGrzxo6jqoP8fI JWtQ== X-Gm-Message-State: AOJu0YyU/tDWbVmc3QJsLBm9cU0fSfDPcQJZuW5A7P3zNHLwkllBKfxx LBHQc57OUXFu44g/G2bu7w8i8Fj//7BsGcPpGSx/Bz87 X-Google-Smtp-Source: AGHT+IFhM8g8JVeFko+vvUjPQvLOOaDpOYv+X3HTV2UJ5p/xbROQYzgSyUdB8tXDOnAC3oPk3GUz/o6gZ1Nk/cvF0ZI= X-Received: by 2002:a05:6512:5cc:b0:50b:c6c7:a777 with SMTP id o12-20020a05651205cc00b0050bc6c7a777mr375598lfo.41.1701246131339; Wed, 29 Nov 2023 00:22:11 -0800 (PST) In-Reply-To: <83bkbf9z1u.fsf@gnu.org> 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:275203 Archived-At: --0000000000005587c3060b463bff Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 27, 2023, 12:12 Eli Zaretskii wrote: > > From: Jo=C3=A3o T=C3=A1vora > > 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=E2=80=AFPM Joseph Turner wrote: > > > > > > Jo=C3=A3o T=C3=A1vora writes: > > > > > > > On Sat, Nov 25, 2023 at 10:43=E2=80=AFPM 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). > Joseph can you try these variations? They're slightly more exact. Also show at least one of the large lisp files or tell me how to generate one. If you still don't find any significant slowdown, I think we can merge your patch. Jo=C3=A3o > --0000000000005587c3060b463bff Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Nov 27, 2023, 12:12 Eli Zaretskii <eliz@gnu.org> wrote:
> From: Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com>= ;
> Date: Sun, 26 Nov 2023 22:02:01 +0000
> Cc: Jonas Bernoulli <jonas@bernoul.li>, 67390@debbugs.gnu.o= rg,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0Adam Porter <adam@alphapapa.net> >
> On Sun, Nov 26, 2023 at 8:38=E2=80=AFPM Joseph Turner <joseph@ushin.o= rg> wrote:
> >
> > Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com> writes:<= br> > >
> > > On Sat, Nov 25, 2023 at 10:43=E2=80=AFPM Joseph Turner <<= a href=3D"mailto:joseph@ushin.org" target=3D"_blank" rel=3D"noreferrer">jos= eph@ushin.org> wrote:
>
> > > So, benchmarking it will have to be, I'm afraid, because= AFAIK
> > > font-locking is a very performance sensitive area of Emacs.<= br> > >
> > Yes.=C2=A0 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=C2=A0 Emacs that scrolls the farthest is the most performant.=C2= =A0 Not
> entirely fail-proof (other processes may interfere, etc), but not
> bad either.

I still recommend this method.=C2=A0 Something like the below:

=C2=A0 (defun scroll-up-benchmark ()
=C2=A0 =C2=A0 (interactive)
=C2=A0 =C2=A0 (let ((oldgc gcs-done)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (oldtime (float-time)))
=C2=A0 =C2=A0 =C2=A0 (condition-case nil (while t (scroll-up) (redisplay))<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error (message "GCs: %d Elapsed time: %f = seconds"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (- gcs-done oldgc) (- (float-time) oldtime))))))

Evaluate the above, and the invoke it at the beginning of a large
file.=C2=A0 Then compare the timings with different font-lock arrangements.=

A variant is to scroll by N lines, not by pages.=C2=A0 Just change the
above to call scroll-up with the argument of N, for example 1 (or any
other number, if you want).
<= br>
Joseph can you try these variations? They're= slightly more exact. Also show at least one of the large lisp files or tel= l me how to generate one. If you still don't find any significant slowd= own, I think we can merge your patch.

Jo=C3=A3o
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
--0000000000005587c3060b463bff--