From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69775: [PATCH] Use regexp-opt in dired-omit-regexp Date: Thu, 21 Mar 2024 12:38:28 +0200 Message-ID: <864jcz3m57.fsf@gnu.org> References: <86o7bh9iz3.fsf@gnu.org> <8734sqjdyz.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 69775@debbugs.gnu.org To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 21 11:39:47 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rnFpq-0003FR-6y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Mar 2024 11:39:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnFpV-0006Ut-G4; Thu, 21 Mar 2024 06:39:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnFpS-0006UQ-PN for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 06:39:22 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnFpS-0005IE-8F for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 06:39:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rnFq5-0004Dd-TC for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 06:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Mar 2024 10:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69775 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69775-submit@debbugs.gnu.org id=B69775.171101756116162 (code B ref 69775); Thu, 21 Mar 2024 10:40:01 +0000 Original-Received: (at 69775) by debbugs.gnu.org; 21 Mar 2024 10:39:21 +0000 Original-Received: from localhost ([127.0.0.1]:35230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnFpR-0004Cc-5G for submit@debbugs.gnu.org; Thu, 21 Mar 2024 06:39:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnFpM-0004CN-Uf for 69775@debbugs.gnu.org; Thu, 21 Mar 2024 06:39:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnFod-00053h-6a; Thu, 21 Mar 2024 06:38:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZHrAmy1yE40sXHKoVHKfD36VXuHxaoYXDcPeeqJ7Is4=; b=eyb0QxC1V87H +rvfOnb0WdxWSC1agnWwc7NIulRaAhwKBtWjjfFdcgVel1Jf5zCCRnM/URChIvOic9y9ivK5LeFoc MMAk+M8CEJ0AsZFyB+7qHWc81askO38Z3bw+/6ezc6ZKlTsX6tjaSP6QETw/fdlXGJzaXRWAC8pA6 BGLuhMvJNLjLdrYiUzW5jl8b+fVDOo97ef+i/BgY/UTNbFD4B8QD/u5cIMkOMYdxXZ9V8BCAI9Qxw nZ0rNb8kYEvV4czmdKeA6B1/Mmawj2sg98h1mqJr3ObwU/g/U0I7S0MJcU2jtA5MDANLkECWBMgrh /PIIjpOi/yFVW038kkVz/A==; In-Reply-To: <8734sqjdyz.fsf@catern.com> (sbaugh@catern.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281894 Archived-At: > From: sbaugh@catern.com > Date: Sat, 16 Mar 2024 17:15:52 +0000 (UTC) > Cc: Spencer Baugh , 69775@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"