unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 14786@debbugs.gnu.org
Subject: bug#14786: 24.3.50; `field-end' is now very slow
Date: Fri, 05 Jul 2013 19:01:17 +0300	[thread overview]
Message-ID: <8338rtyp0y.fsf@gnu.org> (raw)
In-Reply-To: <029969a6-cd0e-45c9-b778-57b5daf98c2a@default>

> Date: Thu, 4 Jul 2013 13:57:52 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: 14786@debbugs.gnu.org
> 
> 1. emacs -Q
> 
> 2. Load library dired-details.el, from Emacs Wiki:
> http://www.emacswiki.org/emacs/download/dired-details.el
> 
> 3. C-x d ; in some directory that has lots of files
> 
> 4.  M-x dired-details-toggle
> 
> 5. M-x dired-details-toggle ; (optional, so you see all info)
> 
> 6. Position the cursor on a file or dir name near the beginning of
> the list.
> 
> 7. M-: (field-end nil)
> 
> The result appears after a few seconds (I'm guessing about 4 sec
> in the directory I used).
> 
> Do the same thing in previous Emacs versions (including as recent
> as 24.3, at least), and the result appears immediately.

Not exactly immediately, but approximately 4 to 5 times faster.

The problem is that dired-details floods the Dired buffer with
overlays.  When there are so many overlays, searching for an end of a
non-existent property takes a lot of time, because Emacs needs to
examine every overlay in the buffer.

What happened between Emacs 24.3 and the current trunk is that the
call

    GET_OVERLAYS_AT (XINT (position), overlay_vec, noverlays, NULL, 0);

in get_char_property_and_overlay got roughly 4 to 5 times slower.  I
don't know why this slowdown happened, but it just moved the time
needed by field-end from below the annoyance threshold to well above
it.

If someone can find out why GET_OVERLAYS_AT is now slower, we could
see if that could be fixed.  But it's quite possible that the change
which caused that fixed some bug that we don't want to re-introduce.
In any case, I think having so many overlays in a buffer is asking for
trouble.





  reply	other threads:[~2013-07-05 16:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<82afc751-3de7-4315-833d-fa6c9ab9378a@default>
     [not found] ` <<83sizuz791.fsf@gnu.org>
2013-07-04 20:57   ` bug#14786: 24.3.50; `field-end' is now very slow Drew Adams
2013-07-05 16:01     ` Eli Zaretskii [this message]
2021-12-04  3:45     ` Lars Ingebrigtsen
2021-12-04 16:36       ` bug#14786: [External] : " Drew Adams
2021-12-04 19:05         ` Lars Ingebrigtsen
     [not found] <<029969a6-cd0e-45c9-b778-57b5daf98c2a@default>
     [not found] ` <<8338rtyp0y.fsf@gnu.org>
2013-07-05 17:06   ` Drew Adams
2013-07-05 18:33     ` Eli Zaretskii
2013-07-04  5:34 Drew Adams
2013-07-04 15:15 ` Eli Zaretskii

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=8338rtyp0y.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=14786@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).