>>>> "sjt" == Stephen J Turnbull
<stephen(a)xemacs.org> writes:
sjt> For example, here's the output of (extents-at (point)) in a Gnus
sjt> summary buffer:
sjt> (#<extent (1, 10542) D paste-function text-prop 0xa062cec> ;;
Uh-oh....
The presence of this monster extent is due to Gnus's abuse of text
properties as a "portable" way to unify overlays and text properties
across Emacsen. As usual, Gnus abuses turn out to be a great way to
find XEmacs bugs, though!
What happens is that because text properties coalesce, some property
that is applied to every line in the summary buffer ends up swallowing
the whole buffer. The text property in question is 'start-open, and
the value is t. (This is badly broken, since 'start-open is not a
property of the text, but of the extent itself; it cannot usefully be
a text property since extents carry only one text property. Ie, what
we have here is an extent whose only purpose is to announce that it
itself is start-open.)
BTW: I wonder if this is why custom, especially the face editor, seems
slow to start up; IIRC custom buffers have a buffer-wide read-only
property.
Quick fix: This patch eliminates this text property (completely safe
since this is a no-op as far as Gnus functionality is concerned), and
gives me a 33% speedup based on wall clock time in summary generation
on a 2500 message group in an XEmacs with Mule and full error checking
ON. NOT TESTED in an OPTIMIZED XEmacs yet. (Reading of headers is
still unconscionably slow for me, but I believe that's documented in
the Gnus manual for large nnml groups because of all the disk I/O
needed.)
--- gnus-xmas.el~ 2004-09-28 11:21:10.000000000 +0900
+++ gnus-xmas.el 2005-10-20 09:16:57.000000000 +0900
@@ -200,12 +200,10 @@
(add-spec-to-specifier current-display-table table (current-buffer) nil)))
(defun gnus-xmas-add-text-properties (start end props &optional object)
- (add-text-properties start end props object)
- (put-text-property start end 'start-closed nil object))
+ (add-text-properties start end props object))
(defun gnus-xmas-put-text-property (start end prop value &optional object)
- (put-text-property start end prop value object)
- (put-text-property start end 'start-closed nil object))
+ (put-text-property start end prop value object))
(defun gnus-xmas-extent-start-open (point)
(map-extents (lambda (extent arg)
GNUS HACKERS TAKE NOTE: The function `gnus-xmas-extent-start-open'
maps over the extents near some arbitrary buffer position; I'm not
sure from Ben's descriptions whether this is an operation that is
affected by large extents. It's only used in the *Group* buffer IIRC,
so even if so, probably the performance hit is negligible for most
people.
--
School of Systems and Information Engineering
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.