all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: yantar92@posteo.net, mitchellahren@gmail.com, 71644@debbugs.gnu.org
Subject: bug#71644: 30.0.50; Severe slowdown in larger files with markers beginning in emacs 29+
Date: Wed, 26 Jun 2024 14:41:06 +0300	[thread overview]
Message-ID: <861q4k9bjh.fsf@gnu.org> (raw)
In-Reply-To: <jwv5xtwzs7t.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 25 Jun 2024 16:54:44 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Mitchell <mitchellahren@gmail.com>,  Eli Zaretskii <eliz@gnu.org>,
>   71644@debbugs.gnu.org
> Date: Tue, 25 Jun 2024 16:54:44 -0400
> 
> I instrumented the bytes<->chars routines to try and keep track of what
> happens there.  This gives me a histogram showing how many times the
> conversion routines consulted N markers as well as another histogram
> telling me how many times those routines scanned between M*100B and
> (M+1)*100B of text.
> Oh and it gives me the number of markers in the buffer as well (the
> histogram is not buffer-local, but there's basically only one buffer in
> that session).
> 
> The result are below (followed by the actual code).
> There are several odd things in there:
> 
> - The markers histogram is weirdly flat.
> - The markers histogram seems to have a threshold around 800
>   I can't explain.  It seems directly related to the buffer size, tho:
>   with a file half the size, I get half as many markers (40k) and
>   a threshold in the histogram around 400.
> - The number of times we consider exactly 1 marker is probably "too
>   high" because the C code happens to look at the first marker before
>   checking if it's necessary.

The fact that it's related to buffer size is probably because your
test buffer is basically N >> 1 repetitions of the same pattern, so
whatever Org does it does that N times, where N is directly
proportional to the buffer size.

Questions:

How many markers are there in this buffer during the experiment where
you produced the histogram you've posted?  My guess is 48400 or
thereabouts?

Also, what were the buffer positions where you tried your editing
operations?  In particular, where those positions distributed evenly
over the buffer?

And questions to Ihor: what are the reasons Org creates these markers?
In particular, is there any way to know or guess whether these markers
will be distributed more-or-less evenly over the buffer text, or
clustered near some specific positions?  Also, does Org move these
markers frequently, or do they stay put once created?





  reply	other threads:[~2024-06-26 11:41 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19  5:25 bug#71644: 30.0.50; Severe slowdown in larger files with markers beginning in emacs 29+ Mitchell
2024-06-19 12:56 ` Eli Zaretskii
2024-06-20 13:49   ` Ihor Radchenko
2024-06-20 16:11     ` Eli Zaretskii
2024-06-20 16:24       ` Eli Zaretskii
2024-06-20 18:57   ` Mitchell
2024-06-20 19:04     ` Eli Zaretskii
2024-06-21  2:46       ` Mitchell
2024-06-21  6:19         ` Ihor Radchenko
2024-06-21 20:53           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-22  5:23             ` Gerd Möllmann
2024-06-22 14:10             ` Ihor Radchenko
2024-06-22 15:52               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-25  3:07               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-25  4:00                 ` Eli Zaretskii
2024-06-25  9:30                 ` Ihor Radchenko
2024-06-25 13:44                   ` Eli Zaretskii
2024-06-25 13:50                     ` Ihor Radchenko
2024-06-25 13:57                       ` Eli Zaretskii
2024-06-25 14:25                         ` Ihor Radchenko
2024-06-26  3:53                         ` Mitchell
2024-06-26 12:41                           ` Eli Zaretskii
2024-06-25 20:54                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-26 11:41                   ` Eli Zaretskii [this message]
2024-06-26 12:35                     ` Ihor Radchenko
2024-06-26 13:30                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-26 13:49                       ` Ihor Radchenko
2024-06-26 14:08                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-29 21:27                           ` Mitchell
2024-06-25 21:02               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-21  6:48         ` Eli Zaretskii
2024-06-21 21:06           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-22  6:57             ` Eli Zaretskii
2024-06-22 18:03               ` Mitchell
2024-06-22 18:17                 ` Eli Zaretskii
2024-06-24  7:09                   ` Mitchell
2024-06-24 12:38                     ` Eli Zaretskii
2024-06-25  3:08                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-22 13:53 ` Ihor Radchenko
2024-06-22 14:12   ` Eli Zaretskii
2024-06-22 14:15     ` Eli Zaretskii
2024-06-22 15:09 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

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

  git send-email \
    --in-reply-to=861q4k9bjh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71644@debbugs.gnu.org \
    --cc=mitchellahren@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.