From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#3603: 23.0.94; takes much time to save large non-ASCII buffers Date: Thu, 18 Jun 2009 20:43:28 +0900 Message-ID: References: Reply-To: Kenichi Handa , 3603@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1245330444 8831 80.91.229.12 (18 Jun 2009 13:07:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jun 2009 13:07:24 +0000 (UTC) To: YAMAMOTO Mitsuharu , 3603@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 18 15:07:21 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MHHKo-00022f-Q8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jun 2009 15:07:21 +0200 Original-Received: from localhost ([127.0.0.1]:58213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHHKn-0004X3-VQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jun 2009 09:07:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHGFH-0000WA-A4 for bug-gnu-emacs@gnu.org; Thu, 18 Jun 2009 07:57:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHGFC-0000Qo-7A for bug-gnu-emacs@gnu.org; Thu, 18 Jun 2009 07:57:30 -0400 Original-Received: from [199.232.76.173] (port=51387 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHGFB-0000QI-Jv for bug-gnu-emacs@gnu.org; Thu, 18 Jun 2009 07:57:25 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39168) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MHGFA-0007f3-Jb for bug-gnu-emacs@gnu.org; Thu, 18 Jun 2009 07:57:25 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5IBvLaU022113; Thu, 18 Jun 2009 04:57:21 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5IBo322020810; Thu, 18 Jun 2009 04:50:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kenichi Handa Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 18 Jun 2009 11:50:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3603 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3603-submit@emacsbugs.donarmstrong.com id=B3603.124532541820014 (code B ref 3603); Thu, 18 Jun 2009 11:50:03 +0000 Original-Received: (at 3603) by emacsbugs.donarmstrong.com; 18 Jun 2009 11:43:38 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5IBhV59020008 for <3603@emacsbugs.donarmstrong.com>; Thu, 18 Jun 2009 04:43:33 -0700 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n5IBhS4Y018772; Thu, 18 Jun 2009 20:43:28 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n5IBhSTr024741; Thu, 18 Jun 2009 20:43:28 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id n5IBhStq013229; Thu, 18 Jun 2009 20:43:28 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MHG1g-0000V3-9n; Thu, 18 Jun 2009 20:43:28 +0900 In-reply-to: (message from YAMAMOTO Mitsuharu on Thu, 18 Jun 2009 18:32:37 +0900) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 18 Jun 2009 07:57:30 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28814 Archived-At: In article , YAMAMOTO Mitsuharu 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