[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extremely slow font-lock-mode

From: martin rudalics
Subject: Re: extremely slow font-lock-mode
Date: Tue, 11 Dec 2007 23:32:03 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> I'm experiencing very slow syntax highlighting with emacs-23.0.60
> (GTK+ Version 2.12.1).
> Simply scrolling in source files takes incredibly long (~ 1 second for
> scolling one line backwards).  This is an a dual-core 2 GHZ machine
> ...
> I tried to play with all font-lock and jit-lock customization options
> but only turning font-lock off seemed to make a difference.
> I tried to use elp to instrument relevant packages (mwheel, font-lock,
> jit-lock, mouse, lazy-lock, fast-lock).  After some scrolling (~ 20
> seconds, with pauses, mouse wheel, pg-keys and scrollbar) I get
> the following results:

I suppose you did not turn on lazy-lock or fast-lock, hence these two
are hardly relevant here.

> So, mwheel-scroll seems to behave badly.

Not necessarily.  The figures you see here may comprise font-locking and
many other things.

> However, lots of the
> problematic calls also seem to have been lost.  E.g., scrolling with
> keyboard was also very slow and is not shown in the table.

You probably didn't instrument that.

> I also noticed, that scrolling forward seems to go considerably faster
> than scrolling backwards (maybe this has to do with syntax-driven
> jit-lock?).

Usually it's slower only if you scroll back into _not yet fontified_

> The results are twofold for me:
> First, I don't seem to be using elp right or it is the wrong tool.

You did use it right but it's probably not the right tool for finding
the cause of the problem.

> Ideally, I would like to use a /sampling/ profiler for emacs.
>  - Is there such a thing that can look into running lisp code?
>  - How should I be using elp differently for getting meaningful
>    results?
> Second, font-lock-mode is currently unusable for me.  I started emacs
> with -q, so I don't think my local tweak are to blame.  emacs-22 on my
> local machine is incredibly fast for the same file (also started with
> -q).
>  - What might be to blame here?

First of all we have to find out whether this is mode specific.  Often a
badly constructed regexp can cause such problems.  Did you try with
different major modes?  Next you should try if it's buffer specific.
Can you post the file showing the bug (maybe it's only a small part of
the file that exhibits the problem).

>  - Do you need more details on any aspect of my machine configuration?

Please send these details just as if you reported a bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]