emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: very slow archive-mode


From: Kenichi Handa
Subject: Re: very slow archive-mode
Date: Thu, 13 Mar 2008 16:51:34 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Stefan Monnier <address@hidden> writes:

> > 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:

  (let ((str (buffer-string)))
    (erase-buffer)
    (set-buffer-multibyte t)
    (decode-coding-string str 'no-conversion nil (current-buffer))))

runs much faster than set-buffer-multibyte.  But then, I
think it is better that we read archive files into a
multibyte buffer from the start by no-conversion-multibyte.

As I've just found a bug in handling
no-conversion-multibyte, I'll fix it soon.  After that, I am
going to change auto-coding-alist to use
no-conversion-multibyte for archive files, and adjust
arc-mode and tar-mode.

What do you think?

---
Kenichi Handa
address@hidden

PS. Another idea is keep archive files in a unibyte buffer
and have the file listing part in another multibyte buffer.

More radical idea is to allow changing multibyteness only in
the narrowed region.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]