From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#4407: marked as done (23.1.50; Re: Recentf cleanup optmization) Date: Sun, 13 Sep 2009 21:20:06 +0000 Message-ID: References: <873a6qmtw9.fsf@cyd.mit.edu> <87my51l0sk.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1252876806-8126-0" X-Trace: ger.gmane.org 1252877252 28455 80.91.229.12 (13 Sep 2009 21:27:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Sep 2009 21:27:32 +0000 (UTC) To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 13 23:27:25 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MmwbU-0000b5-R2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Sep 2009 23:27:25 +0200 Original-Received: from localhost ([127.0.0.1]:41600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmwbU-0003AV-39 for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Sep 2009 17:27:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmwbE-00035c-Nm for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 17:27:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mmwb9-00034a-KY for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 17:27:08 -0400 Original-Received: from [199.232.76.173] (port=49712 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mmwb9-00034R-Cw for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 17:27:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:59733) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mmwb8-00057v-BG for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2009 17:27:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8DLQxwk009366; Sun, 13 Sep 2009 14:27:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8DLK6fO008181; Sun, 13 Sep 2009 14:20:06 -0700 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 4407 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31057 Archived-At: This is a multi-part message in MIME format... ------------=_1252876806-8126-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 13 Sep 2009 17:12:06 -0400 with message-id <873a6qmtw9.fsf@cyd.mit.edu> and subject line Re: 23.1.50; Re: Recentf cleanup optmization has caused the Emacs bug report #4407, regarding 23.1.50; Re: Recentf cleanup optmization to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 4407: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D4407 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1252876806-8126-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 11 Sep 2009 19:47:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL,FOURLA,MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8BJl68B014198 for ; Fri, 11 Sep 2009 12:47:07 -0700 Received: from mx10.gnu.org ([199.232.76.166]:55049) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MmC5J-0002w7-F0 for emacs-pretest-bug@gnu.org; Fri, 11 Sep 2009 15:47:05 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MmC5I-0001Dy-C6 for emacs-pretest-bug@gnu.org; Fri, 11 Sep 2009 15:47:05 -0400 Received: from smtp20.orange.fr ([80.12.242.26]:58655) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmC5H-0001DY-Ss; Fri, 11 Sep 2009 15:47:04 -0400 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2018.orange.fr (SMTP Server) with ESMTP id 1677E20000AC; Fri, 11 Sep 2009 21:47:02 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2018.orange.fr (SMTP Server) with ESMTP id 0096620000A7; Fri, 11 Sep 2009 21:47:01 +0200 (CEST) Received: from COCOTTE (ARennes-256-1-116-144.w90-32.abo.wanadoo.fr [90.32.115.144]) by mwinf2018.orange.fr (SMTP Server) with ESMTP id 63B8220000AC; Fri, 11 Sep 2009 21:47:01 +0200 (CEST) X-ME-UUID: 20090911194701408.63B8220000AC@mwinf2018.orange.fr From: vincent.belaiche@gmail.com (Vincent =?iso-8859-1?Q?Bela=EFche?=) To: emacs-pretest-bug@gnu.org, monnier@IRO.UMontreal.CA Cc: emacs-devel@gnu.org Subject: 23.1.50; Re: Recentf cleanup optmization Date: Fri, 11 Sep 2009 21:49:15 +0200 Message-ID: <87my51l0sk.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. --=-=-= Content-Disposition: inline Dear Stefan, I've tried now to follow as strictly as possible the instruction from info node "(emacs) Sending Patches". * Explanation of change: function `recentf-cleanup' can be very slow when the recentf-max-saved-items is significant, e.g. 60 items. This is due to this that duplicate items are removed with a iterative search (which means that cleanup is made in quadratic time). The change consists in using a search based on a hash table, so that the cleanup is in linear time. Function impacted are function `recentf-cleanup' and a new function `recentf-string-key' is created. * patch made with diff -c is attached. file [d:/msys/temp/recentf.el Fri Sep 11 19:41:51 2009] is download from CVS, and file [recentf.el Wed Sep 2 16:34:04 2009] is the modified one. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=recentf.el.diff Content-Description: Patch to recentf.el *** recentf.el Wed Sep 2 16:34:04 2009 --- d:/msys/temp/recentf.el Fri Sep 11 19:41:51 2009 *************** *** 310,322 **** (string-equal (downcase s1) (downcase s2)) (string-equal s1 s2))) - (defsubst recentf-string-key (s) - "Return a string that is used for `recentf-string-equal' or - `recentf-string-lessp' comparisons. " - (if recentf-case-fold-search - (downcase s) s)) - - (defsubst recentf-string-lessp (s1 s2) "Return non-nil if string S1 is less than S2 in lexicographic order. Ignore case if `recentf-case-fold-search' is non-nil." --- 310,315 ---- *************** *** 1314,1334 **** That is, remove duplicates, non-kept, and excluded files." (interactive) (message "Cleaning up the recentf list...") ! (let ((n 0) ! newlist ! hk ! (ht (make-hash-table ! :size recentf-max-saved-items ! :test 'equal))) (dolist (f recentf-list) ! (setq f (recentf-expand-file-name f) ! hk (recentf-string-key f)) (if (and (recentf-include-p f) (recentf-keep-p f) ! (not (gethash hk ht))) ! (progn ! (push f newlist) ! (puthash hk t ht)) (setq n (1+ n)) (message "File %s removed from the recentf list" f))) (message "Cleaning up the recentf list...done (%d removed)" n) --- 1307,1319 ---- That is, remove duplicates, non-kept, and excluded files." (interactive) (message "Cleaning up the recentf list...") ! (let ((n 0) newlist) (dolist (f recentf-list) ! (setq f (recentf-expand-file-name f)) (if (and (recentf-include-p f) (recentf-keep-p f) ! (not (recentf-string-member f newlist))) ! (push f newlist) (setq n (1+ n)) (message "File %s removed from the recentf list" f))) (message "Cleaning up the recentf list...done (%d removed)" n) --=-=-= Content-Disposition: inline In GNU Emacs 23.1.50.1 (i386-mingw-nt5.0.2195) of 2009-07-25 on COCOTTE Windowing system distributor `Microsoft Corp.', version 5.0.2195 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: FRA value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Info Minor modes in effect: shell-dirtrack-mode: t recentf-mode: t mail-abbrevs-mode: t iswitchb-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: ) ) M-q s SPC o n SPC a SPC h a s h SPC t a b l e , s SPC o SPC SPC s o SPC t h a t SPC t h e SPC c l e a n u p SPC i s SPC i n SPC q u a d r a l i n e a r SPC t i m e . SPC F u n c t i o n SPC i m p a c t e d SPC a r e SPC f u n c t i o n C-SPC SPC ` C-y SPC a n d SPC C-x o C-s C-s C-a C-s c l e a n C-w C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-w C-w C-s C-s C-s C-s C-SPC C-x o a SPC n e w SPC f u n c t i o n SPC C-y ` ' SPC i s SPC c r e a t e d . C-x o C-x C-h i M-x b u g - r e p o r t C-a M-d b u g e m Recent messages: Mark set [4 times] Auto-saving...done Mark set Mark saved where search started Auto-saving...done Mark set [2 times] Mark saved where search started [3 times] Mark set [2 times] Making completion list... iswitchb-read-buffer: Command attempted to use minibuffer while in minibuffer Load-path shadows: d:/Programme/GNU/emacs-extension/cedet/common/ezimage hides d:/Programme/GNU/Emacs/lisp/ezimage c:/Documents and Settings/Vincent/Application Data/.emacs.d/etc/custom hides d:/Programme/GNU/Emacs/lisp/custom --=-=-=-- ------------=_1252876806-8126-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4407-done) by emacsbugs.donarmstrong.com; 13 Sep 2009 21:10:40 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.6 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8DLAd5X006609 for <4407-done@emacsbugs.donarmstrong.com>; Sun, 13 Sep 2009 14:10:40 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 3FE6557E26C; Sun, 13 Sep 2009 17:12:06 -0400 (EDT) From: Chong Yidong To: Vincent =?utf-8?Q?Bela=C3=AFche?= Cc: 4407-done@emacsbugs.donarmstrong.com Subject: Re: 23.1.50; Re: Recentf cleanup optmization Date: Sun, 13 Sep 2009 17:12:06 -0400 Message-ID: <873a6qmtw9.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Explanation of change: function `recentf-cleanup' can be very slow > when the recentf-max-saved-items is significant, e.g. 60 items. This > is due to this that duplicate items are removed with a iterative > search (which means that cleanup is made in quadratic time). The > change consists in using a search based on a hash table, so that the > cleanup is in linear time. Function impacted are function > `recentf-cleanup' and a new function `recentf-string-key' is created. The change looks good, and I've checked it, with some minor edits, into CVS. (For future reference, note that you sent the patch reversed. You also had trailing whitespace.) Thanks. ------------=_1252876806-8126-0--