Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!uwm.edu!rpi!tale From: tale@cs.rpi.edu (David C Lawrence) Newsgroups: comp.emacs Subject: Re: speeding up describe-mode Keywords: gnus calendar Message-ID: Date: 9 Jan 90 01:09:36 GMT References: <10316@alice.UUCP> Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 35 In article <10316@alice.UUCP> wilber@alice.UUCP (Bob Wilber) writes: > I looked at the C code for that a while back. The problem is that it's > using a quadratic time algorithm for something that could be done in linear > time (buffers are constantly being resized). However, to do this in linear > time requires having a way to precompute how long each piece of text is > going to be after all substitutions have been done (in a recursive fashion). > It looks like a fair amount of work to speed it up. Ok, now since you've described the underlying reason for it, I'll elaborate a little more. (Heck, I didn't even understand you the first time I read it and I supposedly know what you're talking about. :-) > (Yes, it was describe-mode for calendar.el that inspired me to look > into this. It took so long I thought my machine had gone down.) As of GNUS 3.12, one of the packages mentioned in the original keywords as exhibiting the problem, the speed has been greatly increased at the loss of some Ultimate Accuracy In Advertising. The problem with both older versions of GNUS and a slightly older version of calender that I just checked is that it they do a _lot_ of substitutions with substitute-command-keys when the doc string is being prepped for the *Help* buffer. There is indeed a little bit of manipulation which needs to go on to turn "\\[gnus-Subject-next-same-subject]" into "M-C-n". For the calendar-mode I just checked it has to do it thirty-four times in one very large documentation string. GNUS 3.12 has sped up the process by taking out the vast majority of \\[] substitutions intended for substitute-command-keys, leaving it only for those not bound by default and putting in the default bindings for the rest. If the bindings change then this loses, but for 99 44/100 % of the time it will be true enough. Dave -- (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))