[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: very slow archive-mode
From: |
Stefan Monnier |
Subject: |
Re: very slow archive-mode |
Date: |
Thu, 13 Mar 2008 11:08:52 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
>> > I regularly open Java source archive (JAR of several tens of megabytes)
>> > in Emacs. Recently I recompiled Emacs from CVS and noticed that process
>> > of opening and parsing archive had become times slower (didn't measure
>> > precisely, but I guess about 5--10x slowdown is there). Can anyone
>> > investigate the problem or just guess what changes caused it? I don't
>> > remember when I compiled Emacs previously, I guess it was a couple month
>> > old.
>> I reported a similar problem. I believe set-buffer-multibyte is *a lot*
>> slower now, and may even have a time complexity of O(N^2).
> I suspect so too. Now set-buffer-multibyte must convert
> more 8-bit bytes to mutlibyte forms and that results in more
> movement and increasing of the gap. This code:
Also, IIUC the 8-bit bytes that are not represented as a single byte and
not only more numerous, but they also take up more space (they used to
take up just 2 bytes but now they take up what 3? 4? 5 bytes?).
For this reason, we should rewrite the set-buffer-multibyte to do things
in two passes: either a first that computes the final size and allocates
the destination and a second that does no re-allocation, or a first that
converts into too-large a destination and a second that shrinks it back
to a reasonable size.
Stefan