GNU bug report logs - #6810
23.2; dired-omit-mode makes dired slow

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Fri, 6 Aug 2010 16:31:02 UTC

Severity: normal

Found in version 23.2

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6810 in the body.
You can then email your comments to 6810 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6810; Package emacs. (Fri, 06 Aug 2010 16:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 06 Aug 2010 16:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; dired-omit-mode makes dired slow
Date: Fri, 06 Aug 2010 16:19:57 +0100
When dired-omit-mode is on, operations on marked files become much
slower. To see this, following these steps:

1. Emacs -q

2. eval:
  (require 'dired-x)
  (add-hook 'dired-mode-hook 'dired-omit-mode)

3. C-x d and enter emacs/lisp (or any dir that has a few dozen files)

4. Mark all files by typing: * / t

5. Change mode to 444 by typing: M 444 RET


For every marked file, a message is displayed something like:
   Redisplaying...xyz.el
   Omitting...
   (Nothing to omit)

Can this inefficiency be rid of? Thank you.

Leo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6810; Package emacs. (Sat, 04 Dec 2010 17:29:01 GMT) Full text and rfc822 format available.

Message #8 received at 6810 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: 6810 <at> debbugs.gnu.org
Subject: Re: bug#6810: 23.2; dired-omit-mode makes dired slow
Date: Sat, 04 Dec 2010 17:34:21 +0000
On 2010-08-06 16:19 +0100, Leo wrote:
> When dired-omit-mode is on, operations on marked files become much
> slower. To see this, following these steps:
>
> 1. Emacs -q
>
> 2. eval:
>   (require 'dired-x)
>   (add-hook 'dired-mode-hook 'dired-omit-mode)
>
> 3. C-x d and enter emacs/lisp (or any dir that has a few dozen files)
>
> 4. Mark all files by typing: * / t
>
> 5. Change mode to 444 by typing: M 444 RET
>
>
> For every marked file, a message is displayed something like:
>    Redisplaying...xyz.el
>    Omitting...
>    (Nothing to omit)
>
> Can this inefficiency be rid of? Thank you.
>
> Leo

`dired-do-redisplay' iterates over the marked files calling
dired-update-file-line which triggers dired-after-readin-hook (see line
1132 in dired-aux). So that hook is being run for as many times as the
number of files marked.

Any objection to something like this:

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 62d6928..90fd1e69 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1017,10 +1017,13 @@
     ;; message much faster than making dired-map-over-marks show progress
     (dired-uncache
      (if (consp dired-directory) (car dired-directory) dired-directory))
-    (dired-map-over-marks (let ((fname (dired-get-filename)))
+    (dired-map-over-marks (let ((fname (dired-get-filename))
+                                ;; disable readin hook until later
+                                (dired-after-readin-hook nil))
 			    (message "Redisplaying... %s" fname)
 			    (dired-update-file-line fname))
 			  arg)
+    (run-hooks 'dired-after-readin-hook)
     (dired-move-to-filename)
     (message "Redisplaying...done")))
 
Leo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6810; Package emacs. (Sat, 04 Dec 2010 22:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 6810 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Leo <sdl.web <at> gmail.com>
Cc: 6810 <at> debbugs.gnu.org
Subject: Re: bug#6810: 23.2; dired-omit-mode makes dired slow
Date: Sat, 04 Dec 2010 17:19:28 -0500
Leo <sdl.web <at> gmail.com> writes:

> `dired-do-redisplay' iterates over the marked files calling
> dired-update-file-line which triggers dired-after-readin-hook (see line
> 1132 in dired-aux). So that hook is being run for as many times as the
> number of files marked.
>
> Any objection to something like this:

Shouldn't this handle dired-before-readin hook too?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6810; Package emacs. (Sun, 05 Dec 2010 05:15:02 GMT) Full text and rfc822 format available.

Message #14 received at 6810 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 6810 <at> debbugs.gnu.org
Subject: Re: bug#6810: 23.2; dired-omit-mode makes dired slow
Date: Sun, 05 Dec 2010 05:20:07 +0000
On 2010-12-04 22:19 +0000, Chong Yidong wrote:
> Shouldn't this handle dired-before-readin hook too?

I think at the time of running dired-map-over-marks, dired already
passed before-readin stage. But I am not entirely sure.

Best,
Leo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6810; Package emacs. (Mon, 06 Dec 2010 19:50:03 GMT) Full text and rfc822 format available.

Message #17 received at 6810 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Leo <sdl.web <at> gmail.com>
Cc: 6810 <at> debbugs.gnu.org
Subject: Re: bug#6810: 23.2; dired-omit-mode makes dired slow
Date: Mon, 06 Dec 2010 14:55:36 -0500
Leo <sdl.web <at> gmail.com> writes:

> On 2010-12-04 22:19 +0000, Chong Yidong wrote:
>> Shouldn't this handle dired-before-readin hook too?
>
> I think at the time of running dired-map-over-marks, dired already
> passed before-readin stage.

So it is.

I've committed your fix, thanks.





bug closed, send any further explanations to Leo <sdl.web <at> gmail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Mon, 06 Dec 2010 19:51:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Jan 2011 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.