emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: slow redisplay after changing cursor color


From: Kim F. Storm
Subject: Re: slow redisplay after changing cursor color
Date: Mon, 13 Sep 2004 12:12:47 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     (require 'cl)
>     (loop for i from 0 to 500 by 1
>         do (set-cursor-color (if (eq 1 (mod i 2))
>                               "blue"
>                             "red"))
>         (sit-for 0))
>
> I figured out why this is so slow.  Every time it changes
> the cursor color, this alters the cursor-color face, and that
> causes init_iterator to call free_all_realized_faces.
> That empties the face cache, so all the faces have to
> be realized again.  This does a lot of consing, so
> it causes GC also.
>
> The only solution I see is to arrange that changing a user-level
> face won't do free_all_realized_faces.  Perhaps it could do this
> only if the font has actually been used in a realized face.
>
> Is anyone interested in working on that?

An much simpler approach would be to state in the docs (manual and doc
string) that the effect of deriving other faces from "cursor",
"mouse" and a few other special-purpose faces is undefined.

We could even give those faces a special 'no-derive property so
e.g. defface / customize-face could check for and avoid such faces.

Then we can handle those faces specially  by simply not calling
free_all_realized_faces when changing them.

-- 
Kim F. Storm  http://www.cua.dk





reply via email to

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