From mituharu@math.s.chiba-u.ac.jp Thu Jun 18 02:32:54 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 Jun 2009 09:32:54 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,FOURLA,MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5I9Wn3j000734 for ; Thu, 18 Jun 2009 02:32:51 -0700 Received: from mail.gnu.org ([199.232.76.166]:45725 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MHDzE-0001OA-Bg for emacs-pretest-bug@gnu.org; Thu, 18 Jun 2009 05:32:48 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MHDzA-0006W9-1I for emacs-pretest-bug@gnu.org; Thu, 18 Jun 2009 05:32:45 -0400 Received: from ntp.math.s.chiba-u.ac.jp ([133.82.132.2]:55488 helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHDz9-0006VL-Ay for emacs-pretest-bug@gnu.org; Thu, 18 Jun 2009 05:32:43 -0400 Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id C94732C40 for ; Thu, 18 Jun 2009 18:32:37 +0900 (JST) Date: Thu, 18 Jun 2009 18:32:37 +0900 Message-ID: From: YAMAMOTO Mitsuharu To: emacs-pretest-bug@gnu.org Subject: 23.0.94; takes much time to save large non-ASCII buffers User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) Organization: Faculty of Science, Chiba University MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by monty-python.gnu.org: NetBSD 3.0 (DF) 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. 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. Index: src/coding.c =================================================================== RCS file: /sources/emacs/emacs/src/coding.c,v retrieving revision 1.434 diff -c -p -r1.434 coding.c *** src/coding.c 17 Jun 2009 00:42:07 -0000 1.434 --- src/coding.c 18 Jun 2009 06:05:04 -0000 *************** DEFUN ("find-coding-systems-region-inter *** 8638,8644 **** EMACS_INT start_byte, end_byte; const unsigned char *p, *pbeg, *pend; int c; ! Lisp_Object tail, elt; if (STRINGP (start)) { --- 8638,8644 ---- EMACS_INT start_byte, end_byte; const unsigned char *p, *pbeg, *pend; int c; ! Lisp_Object tail, elt, chars_checked; if (STRINGP (start)) { *************** DEFUN ("find-coding-systems-region-inter *** 8696,8701 **** --- 8696,8702 ---- while (p < pend && ASCII_BYTE_P (*p)) p++; while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--; + chars_checked = Fmake_char_table (Qnil, Qnil); while (p < pend) { if (ASCII_BYTE_P (*p)) *************** DEFUN ("find-coding-systems-region-inter *** 8703,8708 **** --- 8704,8711 ---- else { c = STRING_CHAR_ADVANCE (p); + if (!NILP (char_table_ref (chars_checked, c))) + continue; charset_map_loaded = 0; for (tail = coding_attrs_list; CONSP (tail);) *************** DEFUN ("find-coding-systems-region-inter *** 8734,8739 **** --- 8737,8743 ---- p = pbeg + p_offset; pend = pbeg + pend_offset; } + char_table_set (chars_checked, c, Qt); } } Some notes: 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. 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. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/local/share/emacs/23.0.94/etc/DEBUG for instructions. In GNU Emacs 23.0.94.1 (powerpc-apple-darwin9.7.0, X toolkit) of 2009-06-18 on yamamoto-mitsuharu-no-power-mac-g5.local Windowing system distributor `The X.Org Foundation', version 11.0.10402000 configured using `configure '--without-gif' '--without-jpeg' '--without-tiff'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ja_JP.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t From handa@m17n.org Thu Jun 18 04:43:37 2009 Received: (at 3603) by emacsbugs.donarmstrong.com; 18 Jun 2009 11:43:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.5 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 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) 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) Received: by smtp1.aist.go.jp with ESMTP id n5IBhStq013229; Thu, 18 Jun 2009 20:43:28 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MHG1g-0000V3-9n; Thu, 18 Jun 2009 20:43:28 +0900 From: Kenichi Handa To: YAMAMOTO Mitsuharu , 3603@debbugs.gnu.org In-reply-to: (message from YAMAMOTO Mitsuharu on Thu, 18 Jun 2009 18:32:37 +0900) Subject: Re: bug#3603: 23.0.94; takes much time to save large non-ASCII buffers References: Message-Id: Date: Thu, 18 Jun 2009 20:43:28 +0900 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 From mituharu@math.s.chiba-u.ac.jp Fri Jun 19 01:47:00 2009 Received: (at 3603) by emacsbugs.donarmstrong.com; 19 Jun 2009 08:47:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.5 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mathmail.math.s.chiba-u.ac.jp (ntp.math.s.chiba-u.ac.jp [133.82.132.2]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5J8ktZw015554 for <3603@emacsbugs.donarmstrong.com>; Fri, 19 Jun 2009 01:46:57 -0700 Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 653742C44; Fri, 19 Jun 2009 17:46:54 +0900 (JST) Date: Fri, 19 Jun 2009 17:46:54 +0900 Message-ID: From: YAMAMOTO Mitsuharu To: Kenichi Handa Cc: 3603@debbugs.gnu.org Subject: Re: bug#3603: 23.0.94; takes much time to save large non-ASCII buffers In-Reply-To: References: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) Organization: Faculty of Science, Chiba University MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII >>>>> On Thu, 18 Jun 2009 20:43:28 +0900, Kenichi Handa 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 mituharu@math.s.chiba-u.ac.jp From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 16 17:13:05 2010 Received: (at control) by debbugs.gnu.org; 16 Jan 2010 22:13:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NWGtE-00046O-Qx for submit@debbugs.gnu.org; Sat, 16 Jan 2010 17:13:04 -0500 Received: from pantheon-po39.its.yale.edu ([130.132.50.100]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NWGtC-000461-QP for control@debbugs.gnu.org; Sat, 16 Jan 2010 17:13:03 -0500 Received: from furry (173-14-147-246-NewEngland.hfc.comcastbusiness.net [173.14.147.246]) (authenticated bits=0) by pantheon-po39.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o0GMCw6F031625 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 16 Jan 2010 17:12:58 -0500 Received: by furry (Postfix, from userid 1000) id A32CFC05D; Sat, 16 Jan 2010 15:12:58 -0700 (MST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 3603 Date: Sat, 16 Jan 2010 17:12:58 -0500 Message-ID: <87ockt66mt.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) close 3603 thanks From unknown Mon Jun 23 22:04:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 14 Feb 2010 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator