unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: slow output in *compilation* buffer
Date: Tue, 25 Aug 2009 23:37:34 +0200	[thread overview]
Message-ID: <87prajlgm9.fsf@lola.goethe.zz> (raw)
In-Reply-To: jwvy6p7rexj.fsf-monnier+emacs@gnu.org

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

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

Does

(setq process-adaptive-read-buffering nil)

make a difference?  I have the suspicion that this still exhibits
pathological behavior sometimes.

-- 
David Kastrup





  reply	other threads:[~2009-08-25 21:37 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
2009-08-25 21:37       ` David Kastrup [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87prajlgm9.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).