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: slow output in *compilation* buffer Date: Sat, 22 Aug 2009 23:27:08 -0700 (PDT) Message-ID: <200908230627.n7N6R8Ph008721@godzilla.ics.uci.edu> References: <200908220823.n7M8NAk5028199@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 1251008962 8543 80.91.229.12 (23 Aug 2009 06:29:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Aug 2009 06:29:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 23 08:29:15 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 1Mf6Zl-0004RS-QJ for ged-emacs-devel@m.gmane.org; Sun, 23 Aug 2009 08:29:14 +0200 Original-Received: from localhost ([127.0.0.1]:57807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mf6Zk-0005Sj-RG for ged-emacs-devel@m.gmane.org; Sun, 23 Aug 2009 02:29:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mf6Ze-0005SV-Tm for emacs-devel@gnu.org; Sun, 23 Aug 2009 02:29:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mf6ZZ-0005QG-Fc for emacs-devel@gnu.org; Sun, 23 Aug 2009 02:29:06 -0400 Original-Received: from [199.232.76.173] (port=55578 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mf6ZZ-0005QC-Aq for emacs-devel@gnu.org; Sun, 23 Aug 2009 02:29:01 -0400 Original-Received: from barrelv2.ics.uci.edu ([128.195.1.114]:60332) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1Mf6ZY-000392-QI for emacs-devel@gnu.org; Sun, 23 Aug 2009 02:29:01 -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 n7N6R8om024468; Sat, 22 Aug 2009 23:27:08 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n7N6R8Ph008721; Sat, 22 Aug 2009 23:27:08 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 22 Aug 2009 21:28:20 -0400") Original-Lines: 61 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n7N6R8om024468 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:114527 Archived-At: Stefan Monnier writes: > > % cumulative self self total > > time seconds seconds calls s/call s/call name > > 31.19 2.72 2.72 52618323 0.00 0.00 lookup_char_property > > 20.30 4.49 1.77 51726150 0.00 0.00 previous_interval > > 12.16 5.55 1.06 208889310 0.00 0.00 Fcdr > > 5.85 6.06 0.51 52444384 0.00 0.00 Fassq > > 5.39 6.53 0.47 4573 0.00 0.00 Fprevious_single_property_change > > 2.64 6.76 0.23 8860105 0.00 0.00 mark_object > > 2.52 6.98 0.22 10621 0.00 0.00 Fsetcar > > 2.29 7.18 0.20 52618300 0.00 0.00 textget > > 1.83 7.34 0.16 59828 0.00 0.00 re_search_2 > > 1.72 7.49 0.15 305181 0.00 0.00 re_match_2_internal > > 1.03 7.58 0.09 82087 0.00 0.00 Fbyte_code > > 0.80 7.65 0.07 9094 0.00 0.00 adjust_for_invis_intang > > 0.80 7.72 0.07 581767 0.00 0.00 find_interval > > 0.69 7.78 0.06 295253 0.00 0.00 next_interval > > 0.69 7.84 0.06 21 0.00 0.02 Fgarbage_collect > > 0.57 7.89 0.05 23886 0.00 0.00 mark_vectorlike > > - not sure why it's GCing that much, but it sounds like something that > can be improved. > - the re_* part of the profile is hard to improve with a quick fix, > I think: it just represents regexp-searching every one of the regexps > in compilation-error-regexp-alist in turn. Of course, there is a way > to do that (a lot) faster, by compiling all those regexps into a DFA. That sounds like a good idea, but it does not look like it will have a huge impact? > - why does the gprof data only seem to account for a bit less than 10s > when you say it takes 25s to complete? Don't know. I double checked and it's consistent. Maybe oprofile can reveal more, I might try that too when I get a chance if nobody beats me to it. > - It seems that they the calls to the interval code come from > compilation-error-properties, but that function should only be called > for regexps that do match, which shouldn't be that many. Can you look > at the text to see if there really are that many matches? BTW, we > should probably be able to make compile.el a bit lazier (i.e. the > font-lock-phase part of the code should do a bit less work by moving > it to the next-error-phase code). The output is about 4500 lines, they all match. BTW, doing the same search with M-x rgrep is MUCH MUCH slower. > Another thing: the compilation code currently uses font-lock-keywords, > but it should probably be changed to use font-lock-syntactic-keywords > instead (which should make it unnecessary to disable jit-lock). > > > So it seems that fontification (and things related to it) are very very expensive. > > compile.el does its work via font-lock, so I do expect most/all of the > time to be spent there. They time spent there seems a bit excessive, so maybe something strange is going on...