Subject: bug#3603: 23.0.94; takes much time to save large non-ASCII buffers

From: YAMAMOTO Mitsuharu <[email-masked]>
Date: Fri, 19 Jun 2009 17:46:54 +0900

>>>>> On Thu, 18 Jun 2009 20:43:28 +0900, Kenichi Handa <[email-masked]> said:

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

I've installed the patch (with changing the variable name to the one
that is consistent with Emacs 22).

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

Thanks for the explanation.  Actually, I couldn't find the part that
may cause GC, and I wondered why there's an adjustment for relocation.

				     YAMAMOTO Mitsuharu
				[email-masked]