unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 70796@debbugs.gnu.org, yantar92@posteo.net
Subject: bug#70796: 30.0.50; bug-reference-mode leading to constant GCing
Date: Sat, 25 May 2024 09:37:18 +0200	[thread overview]
Message-ID: <87jzjiuytt.fsf@gnu.org> (raw)
In-Reply-To: <m234q6cxxg.fsf@pro2.fritz.box> ("Gerd Möllmann"'s message of "Sat, 25 May 2024 06:34:03 +0200")

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

>> But anyhow, I don't see how bug-reference-fontify could be so costly
>> GC-wise...
>
> It is not by itself, AFAICT. Org fontification allocates which ich not
> a problem normally, but with bug-reference active, it is triggered
> over and over again.
>
> Interesting observation:
>
> I just built master without native compilation because that's faster.
> With .elcs only, I don't seem to get the constant GCs with
> 9ebe6aa5f1092241a98e0a16db918e3dc1062f1c which is before your fix.
> With native compilation I do.
>
> Just double-checked that this is indeed the case. Now it gets
> interesting :-/. This is on macOS 14.5, arm64, libgccjit 14.1.

I've now checked out the scratch/igc branch and opened admin/igc.org
with the current emacs (master branch) with native compilation + your
gc-messages patch and garbage-collection-messages set to t.  I cannot
reproduce the problem.

I've also added a (message "BRF") as first expression to
bug-reference-fontify.  After scrolling the buffer from top to bottom,
the function won't be called anymore unless I edit some text.  I assume
that in your case, bug-reference-fontify and font-lock-fontify-region
(the latter including the Org fontification) are run over and over again
unless you remove the former...

I have no explanation.  Especially with admin/igc.org,
bug-reference-fontify is essentially a no-op.  There are no bug
references (text matching bug-reference-bug-regexp), so it's just a
regex search with no match and there are no overlays created or moved.
How can a failed regex search somehow trigger another jit-lock cycle
(and only with native compilation on MacOS)?

>> FWIW, I think goto-address-mode (buttonizing URLs and email addresses)
>> will probably have the same effect, at least the code looks pretty
>> similar.  Can you confirm?
>
> Yes, goto-address-mode has the same effect.

Alright.  Then you can probably even simplify the issue with

--8<---------------cut here---------------start------------->8---
(defun i-do-nothing (start end) nil)
--8<---------------cut here---------------end--------------->8---

and then M-: (jit-lock-register #'i-do-nothing) RET in some buffer,
right?

Bye,
  Tassilo





  reply	other threads:[~2024-05-25  7:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06  6:53 bug#70796: 30.0.50; bug-reference-mode leading to constant GCing Gerd Möllmann
2024-05-06 11:48 ` Eli Zaretskii
2024-05-06 12:35   ` Gerd Möllmann
2024-05-06 14:03     ` Eli Zaretskii
2024-05-06 14:09       ` Gerd Möllmann
2024-05-07  6:58         ` Gerd Möllmann
2024-05-18  6:27           ` Gerd Möllmann
2024-05-18  8:07             ` Eli Zaretskii
2024-05-18 15:49               ` Tassilo Horn
2024-05-24 20:00               ` Tassilo Horn
2024-05-24 20:19                 ` Gerd Möllmann
2024-05-24 20:28                   ` Ihor Radchenko
2024-05-25  4:08                     ` Gerd Möllmann
2024-05-24 21:34                   ` Tassilo Horn
2024-05-25  4:34                     ` Gerd Möllmann
2024-05-25  7:37                       ` Tassilo Horn [this message]
2024-05-25  7:58                         ` Gerd Möllmann
2024-05-25  8:17                           ` Tassilo Horn
2024-06-01  9:05                             ` Gerd Möllmann
2024-06-15  7:54                               ` Eli Zaretskii
2024-06-15  8:07                                 ` Gerd Möllmann
2024-06-16  9:45                                   ` Tassilo Horn
2024-06-16 10:44                                     ` Eli Zaretskii
2024-06-17  7:34                                       ` Andrea Corallo
2024-06-17  8:07                                         ` Andrea Corallo
2024-06-17  8:19                                           ` Tassilo Horn
2024-06-17  8:30                                             ` Andrea Corallo
2024-06-17  9:02                                               ` Gerd Möllmann
2024-06-17  9:30                                                 ` Andrea Corallo
2024-06-17  9:53                                                   ` Gerd Möllmann
2024-06-17 10:10                                                     ` Andrea Corallo
2024-06-17 10:33                                                       ` Gerd Möllmann
2024-06-17 14:13                                                         ` Andrea Corallo
2024-06-17  8:21                                           ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzjiuytt.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=70796@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).