From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: profiling emacs-23.1 vs emacs-22.3 Date: Tue, 25 Aug 2009 11:47:37 -0700 (PDT) Message-ID: <200908251847.n7PIlb4C012720@godzilla.ics.uci.edu> References: <200908032029.n73KTi9h017528@godzilla.ics.uci.edu> <200908240807.n7O87ubg024643@godzilla.ics.uci.edu> <200908241826.n7OIQRhS001092@godzilla.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251226185 19324 80.91.229.12 (25 Aug 2009 18:49:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Aug 2009 18:49:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 25 20:49:37 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mg15M-0006YR-Od for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2009 20:49:37 +0200 Original-Received: from localhost ([127.0.0.1]:55242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg15L-0004Ix-U5 for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2009 14:49:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mg15D-0004GQ-Vi for emacs-devel@gnu.org; Tue, 25 Aug 2009 14:49:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mg158-0004DW-Hr for emacs-devel@gnu.org; Tue, 25 Aug 2009 14:49:26 -0400 Original-Received: from [199.232.76.173] (port=56069 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg158-0004DR-EY for emacs-devel@gnu.org; Tue, 25 Aug 2009 14:49:22 -0400 Original-Received: from barrelv2.ics.uci.edu ([128.195.1.114]:42446) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1Mg157-0006KT-R2 for emacs-devel@gnu.org; Tue, 25 Aug 2009 14:49:22 -0400 Original-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 n7PIlc4s022095; Tue, 25 Aug 2009 11:47:38 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n7PIlb4C012720; Tue, 25 Aug 2009 11:47:37 -0700 (PDT) In-Reply-To: (Kenichi Handa's message of "Tue, 25 Aug 2009 15:07:50 +0900") Original-Lines: 118 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n7PIlc4s022095 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) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114593 Archived-At: Kenichi Handa writes: > In article <200908241826.n7OIQRhS001092@godzilla.ics.uci.edu>, Dan Nicolaescu writes: > > > Kenichi Handa writes: > > In article <200908240807.n7O87ubg024643@godzilla.ics.uci.edu>, Dan Nicolaescu writes: > > > > > Could you try the attached patch? If it improves the > > > > > It does improve performance: > > > > How much in real time? > > > from 22 seconds to 19 (vs about 16 for 22.3 ) > > I see. Then it is worth installing that patch. I've just > done it. Thanks. > > [...] > > > It's still slower than 22.3 though. > > > > > 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? > > > > > The number of Fgarbage_collect calls does not increase that much: > > > from 37 (for 22.3) to 43 (for 23.1). > > > > It seems that c-indent-region has been changed a lot. I'm > > not sure, but perhaps that is the reason. How do the other > > people think? > > > I set the load path to cc-mode from 22.3, it did not make any significant > > difference in the amount of mark_object and Fgarbage_collect calls. > > Ok, then I suspect that the slowness is because of newly > introduced char-tables. I've just installed the attached > change too to improve the performance of object marking in > GC. > > Please try again with the latest code. It's better, but still not too good: % cumulative self self total time seconds seconds calls s/call s/call name 43.03 8.55 8.55 4864529 0.00 0.00 forw_comment 17.16 11.96 3.41 32860 0.00 0.00 scan_sexps_forward 7.90 13.53 1.57 17306 0.00 0.00 scan_lists 7.20 14.96 1.43 50443 0.00 0.00 re_search_2 4.43 15.84 0.88 33382219 0.00 0.00 lookup_char_property 2.42 16.32 0.48 18504890 0.00 0.00 next_interval 2.21 16.76 0.44 8177518 0.00 0.00 mark_object 1.86 17.13 0.37 14382565 0.00 0.00 previous_interval 1.66 17.46 0.33 3329754 0.00 0.00 re_match_2_internal 1.26 17.71 0.25 2156399 0.00 0.00 update_syntax_table 1.16 17.94 0.23 13472 0.00 0.00 Fprevious_single_property_change 1.01 18.14 0.20 23703332 0.00 0.00 Fassq 1.01 18.34 0.20 57233041 0.00 0.00 Fcdr 0.81 18.50 0.16 201989 0.00 0.00 Fbyte_code 0.70 18.64 0.14 43 0.00 0.02 Fgarbage_collect 0.45 18.73 0.09 3943360 0.00 0.00 mark_vectorlike 0.45 18.82 0.09 1976191 0.00 0.00 update_interval 0.40 18.90 0.08 103511 0.00 0.00 skip_chars 0.40 18.98 0.08 3111 0.00 0.00 mark_char_table 0.35 19.05 0.07 33382219 0.00 0.00 textget 0.25 19.10 0.05 1076559 0.00 0.00 find_interval 0.25 19.15 0.05 893966 0.00 0.00 re_iswctype 0.25 19.20 0.05 1294 0.00 0.00 Fsetcar 0.20 19.24 0.04 41380 0.00 0.00 re_compile_pattern 0.15 19.27 0.03 3613707 0.00 0.00 buf_bytepos_to_charpos 0.15 19.30 0.03 589363 0.00 0.00 set_point_both 0.15 19.33 0.03 329641 0.00 0.00 validate_interval_range 0.15 19.36 0.03 15287 0.00 0.00 adjust_for_invis_intang 0.15 19.39 0.03 interval_start_pos 0.10 19.41 0.02 987278 0.00 0.00 Fcons compare to doing the same thing in an emacs -Q -nw session: % cumulative self self total time seconds seconds calls s/call s/call name 46.55 9.10 9.10 4864529 0.00 0.00 forw_comment 15.40 12.11 3.01 32860 0.00 0.00 scan_sexps_forward 7.31 13.54 1.43 17306 0.00 0.00 scan_lists 7.16 14.94 1.40 27938 0.00 0.00 re_search_2 4.40 15.80 0.86 33368915 0.00 0.00 lookup_char_property 2.35 16.26 0.46 18498165 0.00 0.00 next_interval 1.74 16.60 0.34 13472 0.00 0.00 Fprevious_single_property_change 1.64 16.92 0.32 3319319 0.00 0.00 re_match_2_internal 1.53 17.22 0.30 5830028 0.00 0.00 mark_object 1.53 17.52 0.30 2155779 0.00 0.00 update_syntax_table 1.48 17.81 0.29 14382565 0.00 0.00 previous_interval 1.28 18.06 0.25 23687804 0.00 0.00 Fassq 0.72 18.20 0.14 57187184 0.00 0.00 Fcdr 0.66 18.33 0.13 198744 0.00 0.00 Fbyte_code 0.51 18.43 0.10 33368915 0.00 0.00 textget 0.36 18.50 0.07 15287 0.00 0.00 adjust_for_invis_intang 0.36 18.57 0.07 2744 0.00 0.00 Frassq 0.36 18.64 0.07 38 0.00 0.01 Fgarbage_collect 0.31 18.70 0.06 103511 0.00 0.00 skip_chars 0.26 18.75 0.05 10044672 0.00 0.00 Fcar 0.26 18.80 0.05 1976191 0.00 0.00 update_interval 0.26 18.85 0.05 1862 0.00 0.00 mark_char_table 0.20 18.89 0.04 1066193 0.00 0.00 find_interval 0.20 18.93 0.04 73761 0.00 0.00 Flocal_variable_p 0.20 18.97 0.04 20489 0.00 0.00 re_compile_pattern 0.20 19.01 0.04 9351 0.00 0.00 back_comment the -nw -Q session has fewer charsets loaded, the -Q version loads the charset for BIG5 (and others) at startup even though it's running in a LANG=C environment. It seems that the charset data structure is too GC intensive, maybe it's time to rethink it to make it less so.