all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Markus Triska <markus.triska@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 496@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org,
	bug-gnu-emacs@gnu.org, bug-submit-list@donarmstrong.com
Subject: bug#496: 23.0.60; ispell-word becomes increasingly slower
Date: Sat, 28 Jun 2008 17:21:52 +0200	[thread overview]
Message-ID: <m1y74py48f.fsf@gmx.at> (raw)
In-Reply-To: <ulk0pd2jh.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Jun 2008 18:04:02 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> your test.el shows a similar problem with Ispell. So either Aspell and
> Ispell share the same problem, or Emacs still has something to do with
> the slowdown.

Aspell's maintainer Kevin Atkinson has generously sent me the following
patch for Aspell that fixes the problem for me with the latest CVS
version of Aspell. He says it will be in Aspell 0.60.7. Here's a simpler
test case for the problem in versions up to 0.60.6:

  while true; do echo "-"; done | aspell -a

Index: common/config.cpp
===================================================================
RCS file: /sources/aspell/aspell/common/config.cpp,v
retrieving revision 1.79
diff -u -r1.79 config.cpp
--- common/config.cpp	12 Oct 2007 00:33:17 -0000	1.79
+++ common/config.cpp	28 Jun 2008 10:42:10 -0000
@@ -1000,7 +1000,7 @@
       }
       
       assert(ki->def != 0); // if null this key should never have values
-      // directly added to it
+                            // directly added to it
       String value(entry->action == Reset ? get_default(ki) : entry->value);
       
       switch (ki->type) {
@@ -1027,11 +1027,13 @@
           goto error;
         }
 
+        clear_others(entry);
         NOTIFY_ALL(item_updated(ki, val));
         break;
         
       } case KeyInfoString:
         
+        clear_others(entry);
         NOTIFY_ALL(item_updated(ki, value));
         break;
         
@@ -1040,6 +1042,7 @@
         int num;
         
         if (sscanf(value.str(), "%i", &num) == 1 && num >= 0) {
+          clear_others(entry);
           NOTIFY_ALL(item_updated(ki, num));
         } else {
           pe = make_err(bad_value, entry->key, value, _("a positive integer"));
@@ -1049,6 +1052,9 @@
         break;
       }
       case KeyInfoList:
+
+        if (entry->action == ListSet || entry->action == ListClear)
+          clear_others(entry);
         
         NOTIFY_ALL(list_updated(ki));
         break;
@@ -1064,6 +1070,26 @@
       return (PosibErrBase &)pe;
   }
 
+  // Delete all previous entries with the same key
+  void Config::clear_others(Entry * entry) {
+
+    String & key = entry->key;
+    //printf("Clear Others For %s\n", key.c_str());
+    Entry * * cur = &first_;
+    while (*cur != entry) {
+      assert(*cur != *insert_point_);
+      if ((*cur)->key == key) {
+        //printf("JAP \"%s\"!\n", (*cur)->value.c_str());
+        Entry * tmp = *cur;
+        *cur = (*cur)->next;
+        delete tmp;
+      } else {
+        cur = &(*cur)->next;
+      }
+    }
+    
+  }
+
 #undef NOTIFY_ALL
 
 
Index: common/config.hpp
===================================================================
RCS file: /sources/aspell/aspell/common/config.hpp,v
retrieving revision 1.27
diff -u -r1.27 config.hpp
--- common/config.hpp	3 May 2005 05:08:19 -0000	1.27
+++ common/config.hpp	28 Jun 2008 10:42:10 -0000
@@ -132,6 +132,8 @@
 
     PosibErr<int> commit(Entry * entry, Conv * conv = 0);
 
+    void clear_others(Entry * entry);
+
     bool settings_read_in_;
 
   public:








      reply	other threads:[~2008-06-28 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-28  0:26 bug#496: 23.0.60; ispell-word becomes increasingly slower Markus Triska
2008-06-28  7:20 ` Eli Zaretskii
2008-06-28  9:25   ` Markus Triska
2008-06-28 15:04     ` Eli Zaretskii
2008-06-28 15:21       ` Markus Triska [this message]

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=m1y74py48f.fsf@gmx.at \
    --to=markus.triska@gmx.at \
    --cc=496@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=bug-submit-list@donarmstrong.com \
    --cc=eliz@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.