From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18522: 24.4.50; mapcar is very slow Date: Thu, 25 Feb 2016 17:59:41 +0200 Message-ID: <83vb5cg4r6.fsf@gnu.org> References: <8738bkdjqg.fsf@micropit.roche-blanche.homenet.org> <87wppywbaz.fsf@roche-blanche.net> <87d1rquo4a.fsf@roche-blanche.net> <878u2eun9o.fsf@roche-blanche.net> <834md2niqt.fsf@gnu.org> <87k2lyszy2.fsf@roche-blanche.net> <83bn79n66p.fsf@gnu.org> <87vb5hry9y.fsf@roche-blanche.net> <83r3g4lnor.fsf@gnu.org> <87r3g4o4uw.fsf@roche-blanche.net> <83h9h0jwfo.fsf@gnu.org> <87mvqru119.fsf@roche-blanche.net> <8360xfjsyr.fsf@gnu.org> <878u2bs7tl.fsf@roche-blanche.net> <83r3g3iajr.fsf@gnu.org> <87twkypfqx.fsf@roche-blanche.net> <83vb5egg8y.fsf@gnu.org> <87fuwikmzc.fsf@roche-blanche.net> <83io1ege6r.fsf@gnu.org> <87y4a9kh9e.fsf@roche-blanche.net> <87vb5dvf6c.fsf@gnus.org> <8760xdi54j.fsf@roche-blanche.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1456416033 26913 80.91.229.3 (25 Feb 2016 16:00:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Feb 2016 16:00:33 +0000 (UTC) Cc: larsi@gnus.org, 18522@debbugs.gnu.org To: Peter =?UTF-8?Q?M=C3=BCnster?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 25 17:00:21 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aYyKu-0002aa-Nx for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Feb 2016 17:00:16 +0100 Original-Received: from localhost ([::1]:44086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYyKq-00023t-Tp for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Feb 2016 11:00:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYyKk-00020C-Rg for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 11:00:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYyKg-0005nL-Ss for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 11:00:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYyKg-0005nH-Pf for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 11:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aYyKg-0004dK-9y; Thu, 25 Feb 2016 11:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Thu, 25 Feb 2016 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18522 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 18522-submit@debbugs.gnu.org id=B18522.145641599417765 (code B ref 18522); Thu, 25 Feb 2016 16:00:02 +0000 Original-Received: (at 18522) by debbugs.gnu.org; 25 Feb 2016 15:59:54 +0000 Original-Received: from localhost ([127.0.0.1]:46297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYyKY-0004cT-FA for submit@debbugs.gnu.org; Thu, 25 Feb 2016 10:59:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60405) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYyKW-0004cH-Kk for 18522@debbugs.gnu.org; Thu, 25 Feb 2016 10:59:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYyKL-0005id-P9 for 18522@debbugs.gnu.org; Thu, 25 Feb 2016 10:59:47 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYyKL-0005iZ-LU; Thu, 25 Feb 2016 10:59:41 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4879 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aYyKK-0004bz-U1; Thu, 25 Feb 2016 10:59:41 -0500 In-reply-to: <8760xdi54j.fsf@roche-blanche.net> (message from Peter =?UTF-8?Q?M=C3=BCnster?= on Thu, 25 Feb 2016 09:08:44 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113807 Archived-At: > From: Peter Münster > Cc: Eli Zaretskii , 18522@debbugs.gnu.org > Date: Thu, 25 Feb 2016 09:08:44 +0100 > > > Just on a hunch -- what's the value of your `gnus-buffers' variable? > > (# #> # *sent mail to Eli Zaretskii*> # # *Original Article nndraft:drafts*> # # buffer> # # # > # # # # # buffer> # # # # > # # # # # buffer> # # # # > # # # # > # # # > # #) OK, so is the following summary of this long discussion accurate? . Peter noticed that Gnus is very slow entering a group . Gnus is slow because parse-time-string takes a lot of time . parse-time-string is slow because it let-binds case-fold-search . binding case-fold-search is slow because Peter has a lot of buffers, which set-default loops over to change the value of case-fold-search in each one of them . most of the buffers over which set-default loops were actually killed, but they are still in all_buffers list which set-default traverses, although they were supposed to be removed by GC . killed buffers are not removed from all_buffers by GC because they are referenced by gnus-buffers . gnus-buffers references killed buffers because Peter kills buffers behind Gnus back, instead of letting them be killed through gnus-kill-buffer, which would have removed them from gnus-buffers If the above is an accurate account of what we've discovered, then we have several factors here that conspire to make Peter's Gnus slow: . parse-time-string should try to avoid binding case-fold-search globally, or at all . set-default should skip killed buffers . Peter should stop killing Gnus buffers behind Gnus back For the first issue, I propose to modify parse-time-string to use upcase and downcase instead of string-match. E.g., this: (/= (downcase char) char) can be used to detect upper-case characters, and similarly with lower-case. For the second issue, I propose to modify set-default to use FOR_EACH_LIVE_BUFFER instead of FOR_EACH_BUFFER. Does anyone see a problem with that? For the third issue, Peter should make his buffer-killing code look in gnus-buffers, and kill any buffers referenced by it through gnus-kill-buffer. If this involves some standard Emacs features (like 'midnight', perhaps), then those features should also be adapted to gnus-buffers. Comments?