* two minor patches, and expiry inefficiency
@ 1998-03-05 2:21 Ken Raeburn
1998-03-05 17:28 ` Colin Rafferty
0 siblings, 1 reply; 3+ messages in thread
From: Ken Raeburn @ 1998-03-05 2:21 UTC (permalink / raw)
I noticed lots of garbage collection happening during expiry, so I
hacked elp to do some memory-allocation profiling. This brought my
attention to a couple of problems, for which I've included patches
below:
1) I found file-exists-p was getting called on filenames like "/17",
caused by a double-/ in a gnus article pathname.
2) If I have jka-compr loaded but not in use for gnus mail back ends,
all the filenames read from directories get copied via a match-string
operation where the whole string will always be copied. This is
slower to do, and leads to more garbage collection, which will also
slow the process down. And, curiously, a test to check if the regexp
has been modified appears to be cheaper than checking if jka-compr is
in use, at least on my machine (an old, slow alpha).
The patches helped a little. But I've also had to move my mail spool
to NFS, so file accesses are noticably slower. This gave me the, uh,
opportunity to notice another problem. After directory-files has been
called on a group's directory (four times!),
nnml-request-expire-articles is passed a list of article numbers. In
converting them to filenames, it calls nnml-article-to-file, which
calls file-exists-p on each pathname, which means more storage
allocations and file system accesses to find out something for which
we've already gotten all the information we should need.
I have no fix for this yet.
Sat Feb 28 23:33:40 1998 Ken Raeburn <raeburn@cygnus.com>
* nnml.el (nnml-article-to-file): Don't add extra "/" when
building pathname.
* nnheader.el (nnheader-file-to-number): Check value of
nnheader-numerical-short-files instead of checking if jka-compr is
loaded.
Index: nnml.el
===================================================================
RCS file: /0h/users/raeburn/.cvsfiles/lib/elisp/gnus/lisp/nnml.el,v
retrieving revision 1.1.1.39
diff -p -u -r1.1.1.39 nnml.el
--- nnml.el 1998/02/26 04:10:28 1.1.1.39
+++ nnml.el 1998/03/05 01:51:07
@@ -480,7 +480,7 @@ all. This may very well take some time.
;; Just to make sure nothing went wrong when reading over NFS --
;; check once more.
(when (file-exists-p
- (setq file (concat nnml-current-directory "/"
+ (setq file (concat nnml-current-directory
(number-to-string article))))
(nnml-update-file-alist t)
file))))
Index: nnheader.el
===================================================================
RCS file: /0h/users/raeburn/.cvsfiles/lib/elisp/gnus/lisp/nnheader.el,v
retrieving revision 1.1.1.27
retrieving revision 1.12
diff -p -u -r1.1.1.27 -r1.12
--- nnheader.el 1998/03/02 02:35:24 1.1.1.27
+++ nnheader.el 1998/03/02 04:30:00 1.12
@@ -562,7 +562,7 @@ If FILE is t, return the buffer contents
(defsubst nnheader-file-to-number (file)
"Take a file name and return the article number."
- (if (not (boundp 'jka-compr-compression-info-list))
+ (if (string= nnheader-numerical-short-files "^[0-9]+$")
(string-to-int file)
(string-match nnheader-numerical-short-files file)
(string-to-int (match-string 0 file))))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: two minor patches, and expiry inefficiency
1998-03-05 2:21 two minor patches, and expiry inefficiency Ken Raeburn
@ 1998-03-05 17:28 ` Colin Rafferty
1998-03-06 6:19 ` Ken Raeburn
0 siblings, 1 reply; 3+ messages in thread
From: Colin Rafferty @ 1998-03-05 17:28 UTC (permalink / raw)
Ken Raeburn writes:
> Sat Feb 28 23:33:40 1998 Ken Raeburn <raeburn@cygnus.com>
> * nnml.el (nnml-article-to-file): Don't add extra "/" when
> building pathname.
> Index: nnml.el
> ===================================================================
> RCS file: /0h/users/raeburn/.cvsfiles/lib/elisp/gnus/lisp/nnml.el,v
> retrieving revision 1.1.1.39
> diff -p -u -r1.1.1.39 nnml.el
> --- nnml.el 1998/02/26 04:10:28 1.1.1.39
> +++ nnml.el 1998/03/05 01:51:07
> @@ -480,7 +480,7 @@ all. This may very well take some time.
> ;; Just to make sure nothing went wrong when reading over NFS --
> ;; check once more.
> (when (file-exists-p
> - (setq file (concat nnml-current-directory "/"
> + (setq file (concat nnml-current-directory
> (number-to-string article))))
> (nnml-update-file-alist t)
> file))))
This should probably use `expand-file-name' instead of `concat', so that
it totally avoids all the the issues of trailing slashes.
--
Colin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: two minor patches, and expiry inefficiency
1998-03-05 17:28 ` Colin Rafferty
@ 1998-03-06 6:19 ` Ken Raeburn
0 siblings, 0 replies; 3+ messages in thread
From: Ken Raeburn @ 1998-03-06 6:19 UTC (permalink / raw)
Colin Rafferty <craffert@ml.com> writes:
> This should probably use `expand-file-name' instead of `concat', so that
> it totally avoids all the the issues of trailing slashes.
Good point.
Fri Mar 6 01:10:22 1998 Ken Raeburn <raeburn@cygnus.com>
* nnml.el (nnml-article-to-file): Build pathname using
expand-file-name. (Thanks, Colin Rafferty, for catching
this.)
Index: nnml.el
===================================================================
RCS file: /home/raeburn/.cvsfiles/lib/elisp/gnus/lisp/nnml.el,v
retrieving revision 1.1.1.39
diff -p -u -r1.1.1.39 nnml.el
--- nnml.el 1998/02/26 04:10:28 1.1.1.39
+++ nnml.el 1998/03/06 06:18:19
@@ -480,8 +480,8 @@ all. This may very well take some time.
;; Just to make sure nothing went wrong when reading over NFS --
;; check once more.
(when (file-exists-p
- (setq file (concat nnml-current-directory "/"
- (number-to-string article))))
+ (setq file (expand-file-name (number-to-string article)
+ nnml-current-directory)))
(nnml-update-file-alist t)
file))))
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-03-06 6:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-05 2:21 two minor patches, and expiry inefficiency Ken Raeburn
1998-03-05 17:28 ` Colin Rafferty
1998-03-06 6:19 ` Ken Raeburn
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).