[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

nnshimbun optimisation



Hi,

I just elp'd scanning for new articles in a large (~10k articles)
nnshimbun group using Emacs 22. Most of the time was burned in
nnshimbun-search-id:

Function Name                        Call Count  Elapsed Time  Average Time
===================================  ==========  ============  ============
nnshimbun-request-scan               1           16.175174     16.175174
nnshimbun-generate-nov-database      1           16.174949     16.174949
nnshimbun-search-id                  53          14.632969999  0.2760937735

Binding case-fold-search in there yielded a nice speedup:

Function Name                        Call Count  Elapsed Time  Average Time
===================================  ==========  ============  ============
nnshimbun-request-scan               1           1.730321      1.730321
nnshimbun-generate-nov-database      1           1.730097      1.730097
nnshimbun-search-id                  53          0.3751609999  0.0070785094

Patch attached.

regards,
andreas

2006-07-06  Andreas Seltenreich  <seltenreich@xxxxxx>

	* shimbun/nnshimbun.el (nnshimbun-search-id): Bind
	case-fold-search.
Index: nnshimbun.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/shimbun/nnshimbun.el,v
retrieving revision 1.53
diff -u -r1.53 nnshimbun.el
--- nnshimbun.el	3 Mar 2006 12:33:29 -0000	1.53
+++ nnshimbun.el	6 Jun 2006 02:52:57 -0000
@@ -663,7 +663,7 @@
 (defun nnshimbun-search-id (group id)
   (with-current-buffer (nnshimbun-open-nov group)
     (goto-char (point-min))
-    (let (found)
+    (let (found case-fold-search)
       (while (and (not found)
 		  (search-forward id nil t)) ; We find the ID.
 	;; And the id is in the fourth field.