GNU bug report logs - #69775
[PATCH] Use regexp-opt in dired-omit-regexp

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Wed, 13 Mar 2024 15:03:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: sbaugh <at> catern.com
Cc: sbaugh <at> janestreet.com, 69775 <at> debbugs.gnu.org
Subject: Re: bug#69775: [PATCH] Use regexp-opt in dired-omit-regexp
Date: Thu, 21 Mar 2024 12:38:28 +0200
> From: sbaugh <at> catern.com
> Date: Sat, 16 Mar 2024 17:15:52 +0000 (UTC)
> Cc: Spencer Baugh <sbaugh <at> janestreet.com>, 69775 <at> debbugs.gnu.org
> 
> $ ./src/emacs -Q --batch -l ../emacs-29/bench-omit.elc
> files 1, ntimes 100: new 0.008839979999999999 old 0.018162129 new-uncached 0.031399762
> files 10, ntimes 100: new 0.012037615 old 0.040232355000000004 new-uncached 0.037990543
> files 100, ntimes 100: new 0.07368538100000001 old 0.314905271 new-uncached 0.10006527300000001
> files 1000, ntimes 100: new 0.669103498 old 3.076339984 new-uncached 0.693134644
> files 10000, ntimes 100: new 6.336211434 old 30.926320486 new-uncached 6.442762152999999
> 
> So the performance improvement is quite substantial for large
> directories.
> 
> new-uncached is the performance if dired-omit-extensions changes on each
> call of dired-omit-regexp.  For a directory of 1 file, the overhead of
> recomputing regexp-opt every time makes the performance perhaps 2x-3x
> worse, but around 10 files the performance improvement from regexp-opt
> exceeds the overhead, and above that the uncached version still
> outperforms the old version substantially.

SGTM, thanks.

> Certainly, updated patch attached.
> 
> +@defvar dired-omit-size-limit
> +If non-@code{nil}, omitting will be skipped if the directory listing
> +exceeds this size in bytes.

I'd rephrase

   If non-@code{nil}, @code{dired-omit-mode} will be effectively
   disabled in directories whose listing has size (in bytes) larger
   than the value of this option.

> +*** The default value of 'dired-omit-size-limit' has increased.
                                                    ^^^
"was" is better there.

> +(defcustom dired-omit-size-limit 300000
> +  "Maximum buffer size for `dired-omit-mode'.
> +
> +Omitting will be skipped if the directory listing exceeds this size in
                    ^^^^^^^
"disabled"




This bug report was last modified 1 year and 57 days ago.

Previous Next


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