all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, pogonyshev@gmx.net
Subject: Re: very slow archive-mode
Date: Thu, 13 Mar 2008 16:51:34 +0900	[thread overview]
Message-ID: <E1JZiDu-0000BZ-LA@etlken.m17n.org> (raw)
In-Reply-To: <jwvejafpr5m.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Wed, 12 Mar 2008 17:30:49 -0400)

In article <jwvejafpr5m.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> 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
handa@ni.aist.go.jp

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.




  parent reply	other threads:[~2008-03-13  7:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12 20:47 very slow archive-mode Paul Pogonyshev
2008-03-12 21:30 ` Stefan Monnier
2008-03-12 22:41   ` Juri Linkov
2008-03-13  7:51   ` Kenichi Handa [this message]
2008-03-13 15:04     ` Stefan Monnier
2008-03-13 15:08     ` Stefan Monnier
2008-03-14  1:56       ` YAMAMOTO Mitsuharu
2008-03-14  3:43         ` Kenichi Handa
2008-03-14  4:17           ` YAMAMOTO Mitsuharu
2008-03-14  1:03     ` Juri Linkov
2008-03-16  2:23       ` Kenichi Handa
2008-03-16 16:31         ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1JZiDu-0000BZ-LA@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=pogonyshev@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.