Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Cc: emacs-pretest-bug@gnu.org, Elias Oltmanns <oltmanns@uni-bonn.de>,
	ding@gnus.org
Subject: Re: Slow operations on buffers of tens of megabytes
Date: Tue, 07 Nov 2006 15:13:10 +0100	[thread overview]
Message-ID: <v9zmb3wdjd.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <orpsc02vn7.fsf@fsfla.org>

[ Cc-ing Elias Oltmanns; See
  <http://thread.gmane.org/or4ptezc71.fsf%40fsfla.org> or
  <http://thread.gmane.org/gmane.emacs.gnus.general/63925/focus=63929>
  for the full thread. ]

On Mon, Nov 06 2006, Alexandre Oliva wrote:

> On Nov  6, 2006, Reiner Steib <reinersteib+gmane@imap.cc> wrote:
>
>> My guess is that it's problem with case-fold-search when searching for
>> "X-Gnus-Article-Number" in mbox files in Emacs 22 as analyzed by Elias
>> Oltmanns back in June:
>
> Yep, that's it!
>
>> | --- ~/.emacs ---
>> | (unless (< emacs-major-version 22)
>> |   (set-case-syntax 331856 "w" (standard-case-table))
>> |   (set-case-syntax 331857 "w" (standard-case-table)))
>> | --- ~/.emacs ---
>
> This makes gnus blazingly fast again.
>
>> | We could also add a minor mode to set up the case table all the way
>> | for Turkish.
>> | 
>> | Would someone like to do that?
>
> I can try to take a stab at it, but not being an Emacs hacker I just
> barely understand the relationship between the reported bug and the
> ultimate cause reported in the e-mail, nevermind the proposed work
> around, that is indistinguishable from magic to me ;-)
>
> I guess this means I may need some hand-holding, and at this point I'm
> not sure that would be more work than actually making the changes.
> Please advise.

If the problem can't be solved in Emacs, we could maybe change
`nnheader-find-file-noselect' to change the case table for the mbox
files.  The current code reads:

--8<---------------cut here---------------start------------->8---
(defun nnheader-find-file-noselect (&rest args)
  "Open a file with some variables bound.
See `find-file-noselect' for the arguments."
  (let* ((format-alist nil)
	 (auto-mode-alist (mm-auto-mode-alist))
	 (default-major-mode 'fundamental-mode)
	 (enable-local-variables nil)
	 (after-insert-file-functions nil)
	 (enable-local-eval nil)
	 (coding-system-for-read nnheader-file-coding-system)
	 (version-control 'never)
	 (ffh (if (boundp 'find-file-hook)
		  'find-file-hook
		'find-file-hooks))
	 (val (symbol-value ffh)))
    (set ffh nil)
    (unwind-protect
	(apply 'find-file-noselect args)
      (set ffh val))))
--8<---------------cut here---------------end--------------->8---

I expect that (apply 'find-file-noselect args) could be changed to:

--8<---------------cut here---------------start------------->8---
	(with-current-buffer (apply 'find-file-noselect args)
	  (unless (or (featurep 'xemacs)
		      ;; Better check?
		      (< emacs-major-version 22))
	    ;; Apply ASCII-only case-table. Don't modify the
	    ;; standard-case-table.
	    (SOME-CASE-TABLE-CODE)))
--8<---------------cut here---------------end--------------->8---

I don't know much about case tables in Emacs (and I don't have time to
dig deeper into the Lisp Manual).  Any suggestion on what
SOME-CASE-TABLE-CODE should look like?  Alexandre and Elias: Does this
patch give good results?

--8<---------------cut here---------------start------------->8---
--- nnheader.el	01 Aug 2006 12:10:19 +0200	7.24
+++ nnheader.el	07 Nov 2006 15:08:52 +0100	
@@ -997,7 +997,13 @@
 	 (val (symbol-value ffh)))
     (set ffh nil)
     (unwind-protect
-	(apply 'find-file-noselect args)
+	(with-current-buffer (apply 'find-file-noselect args)
+	  (unless (or (featurep 'xemacs)
+		      ;; Better check?
+		      (< emacs-major-version 22))
+	    ;; Apply ASCII-only case-table.  Don't modify the
+	    ;; standard-case-table.
+	    (set-case-table (make-char-table 'case-table))))
       (set ffh val))))
 
 (defun nnheader-directory-regular-files (dir)
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

  reply	other threads:[~2006-11-07 14:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-05  5:37 Alexandre Oliva
2006-11-06  5:02 ` Richard Stallman
2006-11-06  6:02   ` Katsumi Yamaoka
2006-11-06  9:21     ` Reiner Steib
2006-11-06 20:00       ` Alexandre Oliva
2006-11-07 14:13         ` Reiner Steib [this message]
2006-11-08 14:43           ` Reiner Steib
2006-11-09 22:00             ` Alexandre Oliva
2006-11-10 18:42               ` Richard Stallman
2006-11-11  0:37                 ` Reiner Steib
2006-11-13 16:40                   ` Kevin Rodgers
2006-11-14 12:26                     ` Richard Stallman
2006-11-13 17:28               ` Reiner Steib
2006-11-19  9:49                 ` Elias Oltmanns
2006-11-20 12:59                   ` Richard Stallman
2006-11-20 18:22                     ` Elias Oltmanns
2006-11-21  7:47                       ` Richard Stallman
2006-11-21  8:18                         ` Kenichi Handa
2006-11-22 13:15                           ` Richard Stallman
2006-11-12  5:14       ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9zmb3wdjd.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=oltmanns@uni-bonn.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).