all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: emacs-devel@gnu.org
Subject: Re: slow output in *compilation* buffer
Date: Tue, 25 Aug 2009 13:21:43 -0400	[thread overview]
Message-ID: <jwvy6p7rexj.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <200908230627.n7N6R8Ph008721@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Sat, 22 Aug 2009 23:27:08 -0700 (PDT)")

>> - 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?

No, indeed, luckily.

>> - 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.

Maybe it's just the user-time vs system-time.

>> - 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.

Ah, I see.  So yes, the likely solution is to make compile.el lazier:
use font-lock-syntactic-keywords and jit-lock (so the text past the end
of the window doesn't need to be scanned right away), and postpone more
of the work to next-error.

> BTW, doing the same search with M-x rgrep is MUCH MUCH slower.

That sucks.  What does rgrep do so differently to make it even worse?

> They time spent there seems a bit excessive, so maybe something strange
> is going on...

That's also possible.


        Stefan




  reply	other threads:[~2009-08-25 17:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-22  8:23 slow output in *compilation* buffer Dan Nicolaescu
2009-08-23  1:28 ` Stefan Monnier
2009-08-23  6:27   ` Dan Nicolaescu
2009-08-25 17:21     ` Stefan Monnier [this message]
2009-08-25 21:37       ` David Kastrup
2009-08-26  7:33       ` Dan Nicolaescu
2009-08-26 18:56         ` Stefan Monnier
2009-08-24 18:52   ` Dan Nicolaescu
2009-08-24 19:13     ` Chong Yidong
2009-08-24 19:36       ` Dan Nicolaescu
2009-08-24 20:24     ` Dan Nicolaescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvy6p7rexj.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.