Thread View: gnu.emacs.gnus
2 messages
2 total messages
Started by Scott Ballantyne
Fri, 18 Dec 1992 20:46
GNUS need not be slow (Source announcement)
Author: Scott Ballantyne
Date: Fri, 18 Dec 1992 20:46
Date: Fri, 18 Dec 1992 20:46
81 lines
3910 bytes
3910 bytes
From the README file: ------------------------- GNUS need not be slow. GNUS is too slow. It is particularly slow when reading from a local or NFS mounted spool using the nnspool.el library, but even when these problems are fixed, many other operations (such as threading and sorting) remain: too slow. This is to announce the availability of a preliminary new version of gnus which is much faster than the original versions. I am releasing it now rather than later partly because I will soon be out of the country for several weeks, and partly because I would welcome comments or additional improvements from the intrepid. Here are some comparison timings to give you the general idea: =========================================== using 467 articles from alt.atheism: THREADING AND SORTING BY DATE AND SUBJECT: New Version | Gnus 3.14.1 0:47 | 7:25 THREADING ONLY (no sorting): New version | Gnus 3.14.1 0:38 | 2:00 =========================================== The 3.14.1 version I used is not stock - it uses my previously released nnspool.el speedups. Add two minutes to the above times for 3.14.1 with stock nnspool.el (and remember that this time gets worse as the articles in the groups get larger). OTHER IMPROVEMENTS ------------------ Exiting groups when gnus-use-cross-reference is not nil is much faster, searching articles for a random string is much faster, kill files should be faster (this could be improved further) except for kills on xref fields (which will be slower). Adding new newsgroups is faster if you have an active.times file at your site. Plus a few bugs were fixed (such as an assumption that all article times are in GMT - true only for BNEWS sites). NNTP Users can benefit also --------------------------- NNTP users could also benefit from the improvements in threading searching etc. speed if someone who uses nntp wants to make the (probably trivial) changes to nntp.el. If you do, send them to me, and I will make them part of the package. (The changes required are described below). As far as I can tell, all the important features work as well or better than the older GNUS: searching, kill files, digest reading and posting. PROBLEMS -------- However, all is not gravy: Some important internal data structures have changed which may have made this version incompatible with some of your personalizations (such as hooks or additional libraries). As one example, the popular gnus-mark.el will not work any more as is (although I believe the changes are trivial). I do not recommend this package as yet for the casual user. HOW TO GET IT and WHAT YOU NEED ------------------------------- Send mail to sdb@ssr.com with GNUS2 in the subject header. I will send you a shar file in a couple of days with the various programs for gnus. You will need to have the 3.14.1 distribution. You will need the libnov library by Geoff Collyer: anonymous ftp from world.std.com:src/news/nov.dist.tar.Z I have deliberately not made this a plug and go package. You will have to go to a little extra effort to assemble all of the pieces and get it to work. Even though I have been using it for a while now and feel it is pretty stable, I would not guarantee that it is stable enough for the casual user. In spite of this, I hope that some people will find it promising enough to try it out and hopefully report problems so that they can either be fixed or people can be warned about them when (and if) the final version is released.
Re: GNUS need not be slow (Source announcement)
Author: Marc Andreessen
Date: Sat, 19 Dec 1992 11:47
Date: Sat, 19 Dec 1992 11:47
171 lines
6163 bytes
6163 bytes
People not yet familiar with the gnus-speedup code previously posted
more than once may want to try it first. I have no idea how it
compares with Scott's new code, but it does speed up stock GNUS quite
a bit and is trivial to install. Here 'tis:
;; gnus-speedups|Felix Lee|flee@cs.psu.edu
;; |Simple performance enhancements for GNUS
;; |1992-05-18|1.2: stable||
;; This package contains two plug-compatible performance enhancements
;; for GNUS 3.13 and 3.14:
;; 1. A faster version of gnus-find-new-newsgroups, for making GNUS
;; start more quickly.
;; 2. Faster subject and date sorting in the *Subject* buffer.
;; This file must be loaded after "gnus.el". You can do this by
;; adding '(load "gnus-speedups") at the end of your local gnus
;; wrapper, or at the end of "gnus.el". Or you could just include
;; this file directly.
(require 'gnus)
;;;;;
;; 1. A faster version of gnus-find-new-newsgroups.
;; We reduce an O(N**2) process to O(N) by building a hash table for
;; the list of known newsgroups. (It's a little strange that GNUS
;; doesn't already have a hash table for this.)
(defun gnus-find-new-newsgroups ()
"Look for new newsgroups and return names.
`-n' option of options line in .newsrc file is recognized."
(let ( (group nil)
(new-groups nil)
(known-groups (gnus-make-hashtable)) )
;; Build a table of known newsgroups.
(mapcar
(function (lambda (group) (gnus-sethash (car group) t known-groups)))
gnus-killed-assoc)
(mapcar
(function (lambda (group) (gnus-sethash (car group) t known-groups)))
gnus-newsrc-assoc)
;; Compare the active file against what's known.
(mapatoms
(function
(lambda (sym)
(setq group (symbol-name sym))
;; Take into account the -n option.
(and (or (null gnus-newsrc-options-n-no)
(not (string-match gnus-newsrc-options-n-no group))
(and gnus-newsrc-options-n-yes
(string-match gnus-newsrc-options-n-yes group)))
(null (gnus-gethash group known-groups))
(setq new-groups (cons group new-groups)))
))
gnus-active-hashtb)
new-groups
))
;;;;;
;; 2. Faster subject and date sorting in the *Subject* buffer.
;; The basic idea is explained in 'gnus-keyed-sort.
;; Sample hook usage:
;; (setq gnus-Select-group-hook
;; (function
;; (lambda ()
;; (gnus-keyed-sort-headers
;; (function gnus-string-lessp)
;; (function (lambda (it) (gnus-simplify-subject it 're-only))))
;; )))
(defun gnus-keyed-sort (list compare extract)
"Sort LIST stably and return the sorted list. Does not modify LIST.
Arguments are (LIST COMPARE EXTRACT). Elements in the list are
compared as if the predicate were:
(COMPARE (EXTRACT a) (EXTRACT b))
but EXTRACT is run over each element of the list in a preprocessing
stage for efficiency. This reduces the number of EXTRACT calls from
O(N log N) to O(N).
Example: (gnus-keyed-sort load-path 'string< 'downcase)
"
(let ( (keyed-list
(mapcar
(function (lambda (it) (cons (funcall extract it) it)))
list)) )
(setq keyed-list
(sort keyed-list
(function
(lambda (a b) (funcall compare (car a) (car b))))))
(mapcar (function (lambda (it) (cdr it)))
keyed-list)
))
(defun gnus-keyed-sort-headers (compare extract)
"Sort current group's headers by COMPARE and EXTRACT. Sorting is
done as if the predicate were
(COMPARE (EXTRACT a) (EXTRACT b))
See 'gnus-keyed-sort for details.
Note: interrupting the sort leaves the headers unsorted.
"
(setq gnus-newsgroup-headers
(gnus-keyed-sort
gnus-newsgroup-headers
compare extract)))
(defun gnus-Subject-keyed-sort-subjects (compare extract &optional reverse)
"Sort and redisplay the *Subject* buffer by COMPARE and EXTRACT.
Calls 'gnus-keyed-sort-headers to do the sorting. Optional argument
REVERSE means to do an 'nreverse after sorting.
"
(let ( (current (gnus-Subject-article-number)) )
(gnus-keyed-sort-headers compare extract)
(if reverse
(setq gnus-newsgroup-headers (nreverse gnus-newsgroup-headers)))
(gnus-Subject-prepare)
(gnus-Subject-goto-subject current)
))
;; XXX It should be 'gnus-sort-fold-case, not 'case-fold-search
(defun gnus-Subject-sort-by-subject (reverse)
"Sort *Subject* buffer by subject alphabetically. Argument REVERSE
means reverse order. \"Re:\"s are ignored. If 'case-fold-search, then
case of letters will be ignored.
"
(interactive "P")
;; The main complication here is we try to speed up the sort process
;; by hoisting conditions outside the sort.
(gnus-Subject-keyed-sort-subjects
'string<
(if case-fold-search
(function
(lambda (it)
(downcase (gnus-simplify-subject (nntp-header-subject it) 're-only))))
(function
(lambda (it)
(gnus-simplify-subject (nntp-header-subject it) 're-only)))
)
reverse)
)
;; For backward compatibility with GNUS 3.13
(if (not (fboundp 'gnus-sortable-date))
(fset 'gnus-sortable-date 'gnus-comparable-date))
(defun gnus-Subject-sort-by-date (reverse)
"Sort *Subject* buffer by posted date. Argument REVERSE means
reverse order."
(interactive "P")
(gnus-Subject-keyed-sort-subjects
'string<
(function
(lambda (it)
(gnus-sortable-date (nntp-header-date it))))
reverse)
)
Cheers,
Marc
--
Marc Andreessen
Software Development Group
National Center for Supercomputing Applications
marca@ncsa.uiuc.edu
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads