[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slow frame creation when many faces defined
From: |
Kim F. Storm |
Subject: |
Re: Slow frame creation when many faces defined |
Date: |
Mon, 14 Nov 2005 10:24:09 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
David Reitter <address@hidden> writes:
> On 13 Nov 2005, at 23:38, Kim F. Storm wrote:
>
>> It would be interesting if someone would do some profiling of the
>> relevant code to see if there is a specific loop that accounts for
>> most of the time spent here. It could be something which was easy
>> to optimize once we know what it is.
>
> This is the loop you're looking for. It's in face-set-after-frame-
> default (faces.el):
>
> (dolist (face (face-list))
> ;; Don't let frame creation fail because of an invalid face spec.
> (condition-case ()
> (when (not (equal face 'default))
> (face-spec-set face (face-user-default-spec face) frame)
> (internal-merge-in-global-face face frame)
> (when (and (memq window-system '(x w32 mac))
> (or (not (boundp 'inhibit-default-face-x-resources))
> (not (eq face 'default))))
> (make-face-x-resource-internal face frame))
> )
> (error nil)))
>
>
> Note: (not (eq face 'default)) is always t inside the (or ...),
I think this can be simplified to:
;; Don't let frame creation fail because of an invalid face spec.
(condition-case ()
(dolist (face (face-list))
(when (not (equal face 'default))
(face-spec-set face (face-user-default-spec face) frame)
(internal-merge-in-global-face face frame)
(when (memq window-system '(x w32 mac))
(make-face-x-resource-internal face frame))))
(error nil))
Does that make it any faster?
If not (and I doubt it has any great effect), I would like someone to
study the internals of the functions called here to see if they do
something sub-optimal.
What did the previous version (which ran this faster) do here?
What specific part was added that could explain the slow-down?
--
Kim F. Storm <address@hidden> http://www.cua.dk