From dann@godzilla.ics.uci.edu Thu Aug 20 22:20:06 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Aug 2009 05:20:06 +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=-4.5 required=4.0 tests=AWL,FOURLA,PHONENUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7L5K54T015472 for ; Thu, 20 Aug 2009 22:20:06 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeMXk-0006w1-Ka for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 01:20:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeMXf-0006rO-V2 for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 01:20:03 -0400 Received: from [199.232.76.173] (port=49296 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeMXf-0006rL-Lt for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 01:19:59 -0400 Received: from sallyv2.ics.uci.edu ([128.195.1.120]:47597) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MeMXf-0003Uf-12 for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 01:19:59 -0400 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by sallyv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n7L5IBGq000591 for ; Thu, 20 Aug 2009 22:18:11 -0700 (PDT) Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n7L5IAN1015939; Thu, 20 Aug 2009 22:18:10 -0700 (PDT) Date: Thu, 20 Aug 2009 22:18:10 -0700 (PDT) Message-Id: <200908210518.n7L5IAN1015939@godzilla.ics.uci.edu> From: Dan Nicolaescu To: bug-gnu-emacs Subject: calls to char_table_ref slow down 23.1 (vs 22.3) X-Debbugs-No-Ack: yes Lines: 88 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n7L5IBGq000591 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) Take src/config.h run C-x r t on it to insert a space in front of each line. Then build both emacs-23.1 and 22.3 with profiling enabled (-O2 -g -pg). Then run: emacs -Q -nw config.h M-: (indent-region (point-min)(point-max)) RET C-x C-c The 22.3 gprof results: Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 41.29 7.13 7.13 4653244 0.00 0.00 forw_comment 16.10 9.91 2.78 32473 0.09 0.31 scan_sexps_forward 9.09 11.48 1.57 15132 0.10 0.15 re_search_2 5.62 12.45 0.97 17286 0.06 0.15 scan_lists 5.59 13.41 0.96 33462255 0.00 0.00 lookup_char_property 3.36 13.99 0.58 18478958 0.00 0.00 next_interval 2.14 14.37 0.37 129733 0.00 0.00 mark_object 1.80 14.68 0.31 137020 0.00 0.00 skip_chars 1.74 14.97 0.30 14459993 0.00 0.00 previous_interval 1.62 15.26 0.28 57446793 0.00 0.00 Fcdr 1.36 15.49 0.23 2156082 0.00 0.00 update_syntax_table 1.27 15.71 0.22 3315615 0.00 0.00 re_match_2_internal 1.19 15.91 0.20 23687203 0.00 0.00 Fassq 0.87 16.07 0.15 13478 0.01 0.06 Fprevious_single_property_change 0.75 16.20 0.13 33462255 0.00 0.00 textget 0.75 16.32 0.13 228439 0.00 0.00 Fbyte_code 0.52 16.41 0.09 1978403 0.00 0.00 update_interval 0.46 16.50 0.08 1101056 0.00 0.00 find_interval 0.29 16.55 0.05 3613429 0.00 0.00 buf_bytepos_to_charpos 0.26 16.59 0.04 10137050 0.00 0.00 Fcar 0.26 16.64 0.04 1154883 0.00 0.00 balance_an_interval 0.23 16.68 0.04 579275 0.00 0.00 unbind_to The 23.1 gprof results: Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 29.60 7.03 7.03 406111658 0.00 0.00 char_table_ref 26.72 13.37 6.34 4653244 0.00 0.00 forw_comment 11.80 16.17 2.80 32121 0.00 0.00 scan_sexps_forward 5.98 17.59 1.42 23271 0.00 0.00 re_search_2 5.27 18.84 1.25 17289 0.00 0.00 scan_lists 4.13 19.82 0.98 33439981 0.00 0.00 lookup_char_property 1.94 20.28 0.46 18488739 0.00 0.00 next_interval 1.73 20.69 0.41 10038210 0.00 0.00 mark_object 1.26 20.99 0.30 2156799 0.00 0.00 update_syntax_table 1.20 21.27 0.29 sub_char_table_ref 1.10 21.53 0.26 14455134 0.00 0.00 previous_interval 0.88 21.74 0.21 57391428 0.00 0.00 Fcdr 0.88 21.95 0.21 3318263 0.00 0.00 re_match_2_internal 0.72 22.12 0.17 23671456 0.00 0.00 Fassq 0.67 22.28 0.16 196373 0.00 0.00 Fbyte_code 0.59 22.42 0.14 13478 0.00 0.00 Fprevious_single_property_change 0.51 22.54 0.12 38 0.00 0.02 Fgarbage_collect 0.38 22.63 0.09 33439981 0.00 0.00 textget 0.38 22.72 0.09 10115583 0.00 0.00 Fcar [snip] ----------------------------------------------- 0.05 0.22 612/32121 back_comment [28] 2.75 11.33 31509/32121 Fparse_partial_sexp [6] [5] 60.5 2.80 11.55 32121 scan_sexps_forward [5] 5.17 3.76 3796695/4653244 forw_comment [7] 1.62 0.00 93379139/406111658 char_table_ref [8] 0.15 0.86 1092890/2156799 update_syntax_table [11] 0.00 0.00 5096/10115583 Fcar [46] 0.00 0.00 6552/57391428 Fcdr [33] 0.00 0.00 147/952550 Fcons [105] It can be seen that 23.1 is quite a bit slower, and that it has a lot of extra calls to char_table_ref. Is there some easy way to reduce the number of those calls? From handa@m17n.org Thu Aug 20 23:34:15 2009 Received: (at 4222) by emacsbugs.donarmstrong.com; 21 Aug 2009 06:34:15 +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.1 required=4.0 tests=AWL,HAS_BUG_NUMBER, 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 n7L6YC5a029162 for <4222@emacsbugs.donarmstrong.com>; Thu, 20 Aug 2009 23:34:14 -0700 Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n7L6YAk2008946; Fri, 21 Aug 2009 15:34:10 +0900 (JST) env-from (handa@m17n.org) Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n7L6YAJ8026729; Fri, 21 Aug 2009 15:34:10 +0900 (JST) env-from (handa@m17n.org) Received: by smtp2.aist.go.jp with ESMTP id n7L6YAdr026498; Fri, 21 Aug 2009 15:34:10 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MeNhS-0002Wd-7T; Fri, 21 Aug 2009 15:34:10 +0900 From: Kenichi Handa To: Dan Nicolaescu , 4222@debbugs.gnu.org In-reply-to: <200908210518.n7L5IAN1015939@godzilla.ics.uci.edu> (message from Dan Nicolaescu on Thu, 20 Aug 2009 22:18:10 -0700 (PDT)) Subject: Re: bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3) References: <200908210518.n7L5IAN1015939@godzilla.ics.uci.edu> Message-Id: Date: Fri, 21 Aug 2009 15:34:10 +0900 > Take src/config.h run C-x r t on it to insert a space in front of each > line. > Then build both emacs-23.1 and 22.3 with profiling enabled (-O2 -g -pg). > Then run: > emacs -Q -nw config.h > M-: (indent-region (point-min)(point-max)) RET > C-x C-c [...] > It can be seen that 23.1 is quite a bit slower, and that it has a lot of > extra calls to char_table_ref. > Is there some easy way to reduce the number of those calls? Please find which char-table is referred so many times. --- Kenichi Handa handa@m17n.org From dann@godzilla.ics.uci.edu Fri Aug 21 00:08:32 2009 Received: (at 4222) by emacsbugs.donarmstrong.com; 21 Aug 2009 07:08:32 +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=-6.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, IMPRONONCABLE_2,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from barrelv2.ics.uci.edu (barrelv2.ics.uci.edu [128.195.1.114]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7L78UJY003358 for <4222@emacsbugs.donarmstrong.com>; Fri, 21 Aug 2009 00:08:31 -0700 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n7L78Ip1023179; Fri, 21 Aug 2009 00:08:18 -0700 (PDT) Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n7L78H1W016981; Fri, 21 Aug 2009 00:08:17 -0700 (PDT) Date: Fri, 21 Aug 2009 00:08:17 -0700 (PDT) Message-Id: <200908210708.n7L78H1W016981@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Kenichi Handa Cc: 4222@debbugs.gnu.org Subject: Re: bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3) References: <200908210518.n7L5IAN1015939@godzilla.ics.uci.edu> X-Debbugs-No-Ack: yes In-Reply-To: (Kenichi Handa's message of "Fri, 21 Aug 2009 15:34:10 +0900") Lines: 25 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n7L78Ip1023179 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Kenichi Handa writes: > > Take src/config.h run C-x r t on it to insert a space in front of each > > line. > > > Then build both emacs-23.1 and 22.3 with profiling enabled (-O2 -g -pg). > > Then run: > > > emacs -Q -nw config.h > > M-: (indent-region (point-min)(point-max)) RET > > C-x C-c > [...] > > It can be seen that 23.1 is quite a bit slower, and that it has a lot of > > extra calls to char_table_ref. > > > Is there some easy way to reduce the number of those calls? > > Please find which char-table is referred so many times. Unfortunately I am not familiar with this code at all... Setting a breakpoint in char_table_ref and examining `table' there show this: (struct Lisp_Char_Table *) 0x8863fb0 Purpose: "syntax-table" 0 extra slots From cyd@stupidchicken.com Fri Sep 18 16:31:04 2009 Received: (at 4222) by emacsbugs.donarmstrong.com; 18 Sep 2009 23:31:04 +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=-0.4 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po45.its.yale.edu (pantheon-po45.its.yale.edu [130.132.50.79]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8INV3rw026943 for <4222@emacsbugs.donarmstrong.com>; Fri, 18 Sep 2009 16:31:04 -0700 Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244]) (authenticated bits=0) by pantheon-po45.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n8INUvSb015695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 18 Sep 2009 19:30:57 -0400 Received: by furry (Postfix, from userid 1000) id 8C1B1C070; Fri, 18 Sep 2009 19:30:57 -0400 (EDT) From: Chong Yidong To: Dan Nicolaescu Cc: Kenichi Handa , 4222@debbugs.gnu.org Subject: Re: calls to char_table_ref slow down 23.1 (vs 22.3) Date: Fri, 18 Sep 2009 19:30:57 -0400 Message-ID: <87skejomoe.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) > Take src/config.h run C-x r t on it to insert a space in front of each > line. > > Then build both emacs-23.1 and 22.3 with profiling enabled (-O2 -g -pg). > Then run: > > emacs -Q -nw config.h > M-: (indent-region (point-min)(point-max)) RET > C-x C-c > > The 23.1 gprof results: > > Each sample counts as 0.01 seconds. > % cumulative self self total > time seconds seconds calls s/call s/call name > 29.60 7.03 7.03 406111658 0.00 0.00 char_table_ref > 26.72 13.37 6.34 4653244 0.00 0.00 forw_comment I can't reproduce this problem now. Following your recipe, I do observe the indentation taking a looong time, but char_table_ref is not called. Presumably, Handa-san's 2009-08-25 and 2009-08-27 changes fixed this. Should I close the bug, or is there still a problem? From dann@godzilla.ics.uci.edu Fri Sep 18 21:43:25 2009 Received: (at 4222) by emacsbugs.donarmstrong.com; 19 Sep 2009 04:43:25 +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=-6.6 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from barrelv2.ics.uci.edu (barrelv2.ics.uci.edu [128.195.1.114]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8J4hO5I012519 for <4222@emacsbugs.donarmstrong.com>; Fri, 18 Sep 2009 21:43:25 -0700 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n8J4hBPU028611; Fri, 18 Sep 2009 21:43:12 -0700 (PDT) Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n8J4hBNM011012; Fri, 18 Sep 2009 21:43:11 -0700 (PDT) Date: Fri, 18 Sep 2009 21:43:11 -0700 (PDT) Message-Id: <200909190443.n8J4hBNM011012@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Chong Yidong Cc: 4222@debbugs.gnu.org Subject: Re: bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3) References: <87skejomoe.fsf@stupidchicken.com> X-Debbugs-No-Ack: yes In-Reply-To: <87skejomoe.fsf@stupidchicken.com> (Chong Yidong's message of "Fri, 18 Sep 2009 19:30:57 -0400") Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n8J4hBPU028611 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Chong Yidong writes: > > Take src/config.h run C-x r t on it to insert a space in front of each > > line. > > > > Then build both emacs-23.1 and 22.3 with profiling enabled (-O2 -g -pg). > > Then run: > > > > emacs -Q -nw config.h > > M-: (indent-region (point-min)(point-max)) RET > > C-x C-c > > > > The 23.1 gprof results: > > > > Each sample counts as 0.01 seconds. > > % cumulative self self total > > time seconds seconds calls s/call s/call name > > 29.60 7.03 7.03 406111658 0.00 0.00 char_table_ref > > 26.72 13.37 6.34 4653244 0.00 0.00 forw_comment > > I can't reproduce this problem now. Following your recipe, I do observe > the indentation taking a looong time, but char_table_ref is not called. > Presumably, Handa-san's 2009-08-25 and 2009-08-27 changes fixed this. > Should I close the bug, or is there still a problem? There still is a problem, but it is not caused by char_table_ref, that part was fixed by Handa-san. It's up to you if you want to keep this bug, just retitle it, or close it. From handa@m17n.org Fri Sep 18 22:37:32 2009 Received: (at 4222) by emacsbugs.donarmstrong.com; 19 Sep 2009 05:37:32 +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.0 required=4.0 tests=AWL,HAS_BUG_NUMBER, 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 n8J5bUrP020954 for <4222@emacsbugs.donarmstrong.com>; Fri, 18 Sep 2009 22:37:32 -0700 Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n8J5bT9F013518; Sat, 19 Sep 2009 14:37:29 +0900 (JST) env-from (handa@m17n.org) Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n8J5bSm1014743; Sat, 19 Sep 2009 14:37:28 +0900 (JST) env-from (handa@m17n.org) Received: by smtp4.aist.go.jp with ESMTP id n8J5bSTw022482; Sat, 19 Sep 2009 14:37:28 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MosdU-0002KN-5U; Sat, 19 Sep 2009 14:37:28 +0900 From: Kenichi Handa To: Dan Nicolaescu , 4222@debbugs.gnu.org Cc: cyd@stupidchicken.com, 4222@debbugs.gnu.org Subject: Re: bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3) In-Reply-To: <200909190443.n8J4hBNM011012@godzilla.ics.uci.edu> (message from Dan Nicolaescu on Fri, 18 Sep 2009 21:43:11 -0700 (PDT)) References: <87skejomoe.fsf@stupidchicken.com> <200909190443.n8J4hBNM011012@godzilla.ics.uci.edu> Date: Sat, 19 Sep 2009 14:37:28 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In article <200909190443.n8J4hBNM011012@godzilla.ics.uci.edu>, Dan Nicolaescu writes: > I can't reproduce this problem now. Following your recipe, I do observe > the indentation taking a looong time, but char_table_ref is not called. > Presumably, Handa-san's 2009-08-25 and 2009-08-27 changes fixed this. > Should I close the bug, or is there still a problem? > There still is a problem, but it is not caused by char_table_ref, that > part was fixed by Handa-san. > It's up to you if you want to keep this bug, just retitle it, or close it. We still have a problem of slow GC caused by many elements of char-tables (mostly because of charset encoders). My idea for fixing it is to somehow distinguish a char-table that has only integer or (interned) symbol elements from the other normal char-tables, and optimize mark_char_table for it. But, at the moment, I don't have a time to work on it. Perhaps we should open a new bug for that. --- Kenichi Handa handa@m17n.org From handa@m17n.org Wed Sep 23 21:05:22 2009 Received: (at 4222) by emacsbugs.donarmstrong.com; 24 Sep 2009 04:05:22 +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.0 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, 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 n8O45Ku4028287 for <4222@emacsbugs.donarmstrong.com>; Wed, 23 Sep 2009 21:05:21 -0700 Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n8O45IVp022927; Thu, 24 Sep 2009 13:05:18 +0900 (JST) env-from (handa@m17n.org) Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n8O45IGq003215; Thu, 24 Sep 2009 13:05:18 +0900 (JST) env-from (handa@m17n.org) Received: by smtp4.aist.go.jp with ESMTP id n8O45ISC010749; Thu, 24 Sep 2009 13:05:18 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1Mqfa2-0000Ss-36; Thu, 24 Sep 2009 13:05:18 +0900 From: Kenichi Handa To: 4222@debbugs.gnu.org Cc: dann@ics.uci.edu, cyd@stupidchicken.com Subject: Re: bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3) In-Reply-To: (message from Kenichi Handa on Sat, 19 Sep 2009 14:37:28 +0900) References: <87skejomoe.fsf@stupidchicken.com> <200909190443.n8J4hBNM011012@godzilla.ics.uci.edu> Date: Thu, 24 Sep 2009 13:05:18 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In article , Kenichi Handa writes: > We still have a problem of slow GC caused by many elements > of char-tables (mostly because of charset encoders). My > idea for fixing it is to somehow distinguish a char-table > that has only integer or (interned) symbol elements from the > other normal char-tables, and optimize mark_char_table for > it. But, at the moment, I don't have a time to work on it. I tried to implement a new function mark_charsets that marks encoder char-tables of charsets in a special way, but it improved the performance only a few percent. It means that the current loop in mark_char_table is fast enough. By the way, I've misunderstood the output of gprof. In article <200908240807.n7O87ubg024643@godzilla.ics.uci.edu>, Dan Nicolaescu writes: > One big difference is then time/number of calls to mark_objects > 129733 vs 18834514, so 145 times more calls to mark_object. > Do you know where do those come from? Emacs 22 didn't have the function mark_vectorlike and mark_object directly handled the marking of Lisp_Vectorlike by recursive call. And the number 129733 doesn't include the number of such recursive calls. The result of profiling this execution: % time LANG=C emacs-22/src/emacs -Q -batch --eval '(dotimes (i 100) (garbage-collect))' shows this: [8] 82.9 1.35 0.01 183705+25673200 mark_object [8] So the total number of calls is 25856905. The similar tries with Emacs 23 and the trunk are: Emacs-23: [12] 76.6 1.64 0.00 28911397+8925193 mark_object [12] Total number of calls is 37836590. The trunk: [12] 64.2 1.13 0.00 14102473+8981954 mark_object [12] Total number of calls is 23084427. It seems that mark_char_table introduced in the trunk works effectively and leads to less object marking than Emacs 22. So, I think we can close this thread. --- Kenichi Handa handa@m17n.org From cyd@stupidchicken.com Thu Sep 24 16:24:32 2009 Received: (at control) by emacsbugs.donarmstrong.com; 24 Sep 2009 23:24:32 +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=-1.6 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8ONOUqj013802 for ; Thu, 24 Sep 2009 16:24:32 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id ECFCB57E266; Thu, 24 Sep 2009 19:26:07 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 4222 Date: Thu, 24 Sep 2009 19:26:07 -0400 Message-ID: <873a6bdiwg.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii close 4222 thanks From unknown Sat Sep 20 16:32:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 23 Oct 2009 14:24:12 +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