all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>,
	3603@emacsbugs.donarmstrong.com
Subject: bug#3603: 23.0.94; takes much time to save large non-ASCII buffers
Date: Thu, 18 Jun 2009 20:43:28 +0900	[thread overview]
Message-ID: <E1MHG1g-0000V3-9n@etlken> (raw)
In-Reply-To: <wleithrioa.wl%mituharu@math.s.chiba-u.ac.jp> (message from YAMAMOTO Mitsuharu on Thu, 18 Jun 2009 18:32:37 +0900)

In article <wleithrioa.wl%mituharu@math.s.chiba-u.ac.jp>, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

> Steps to reproduce:
>   1. emacs -Q
>   2. C-x ( C-x i .../etc/tutorials/TUTORIAL.ja RET C-x )
>   3. C-u 20 C-x e
>   4. C-x C-s SOME-NEW-FILE-NAME RET

> Result:

>   It takes much time (~10 sec.) to save this ~1MB buffer.
>   Emacs 22 can save it instantly.

I observed it too.

> The slowness comes from that of select-safe-coding-system, in
> particular, find-coding-systems-region(-internal) in it.  The
> following patch makes it much faster (a few sec.) than the current
> version.

It seems that your patch is correct.  Actually, Emacs 22
used the similar method, but I forgot to implement that part
when I re-wrote find-coding-systems-region-internal.  :-(

[...]
>   1. It's still much slower than Emacs 22.  I guess we need to rewrite
>      select-safe-coding-system if we try to make its performance
>      comparable with Emacs 22.  But perhaps we should avoid such
>      changes at this moment.

One possible strategy is to check, at first, whether or not
the default coding system(s) used for encoding (usually
buffer-file-coding-system) can encode the text.

>   2. If the "if (charset_map_loaded) ..." clause in
>      Ffind_coding_systems_region_internal is intended for the
>      relocation caused by GC, then maybe `chars_checked' above (and
>      also `coding_attrs_list') should be GCPROed.

It was.  But, as we modified load_charset_map_from_file to
disable file-name-handlers a while ago, we don't need that
check anymore.  I just forgot to delete all those checks.

---
Kenichi Handa
handa@m17n.org





  reply	other threads:[~2009-06-18 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18  9:32 bug#3603: 23.0.94; takes much time to save large non-ASCII buffers YAMAMOTO Mitsuharu
2009-06-18 11:43 ` Kenichi Handa [this message]
2009-06-19  8:46   ` YAMAMOTO Mitsuharu

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=E1MHG1g-0000V3-9n@etlken \
    --to=handa@m17n.org \
    --cc=3603@emacsbugs.donarmstrong.com \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /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.