all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Slow frame creation when many faces defined
Date: Mon, 14 Nov 2005 10:24:09 +0100	[thread overview]
Message-ID: <m3d5l3bn0m.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <B47FC649-6645-4FC4-B948-C6DFB02627F6@gmail.com> (David Reitter's message of "Mon, 14 Nov 2005 08:33:09 +0000")

David Reitter <david.reitter@gmail.com> 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 <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2005-11-14  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-12 19:56 Slow frame creation when many faces defined David Reitter
2005-11-12 21:07 ` Drew Adams
2005-11-13 20:54 ` Richard M. Stallman
2005-11-13 23:38   ` Kim F. Storm
2005-11-14  8:33     ` David Reitter
2005-11-14  9:24       ` Kim F. Storm [this message]
2005-11-15  8:11 ` YAMAMOTO Mitsuharu
2005-11-15 11:51   ` David Reitter
2005-11-15 16:47     ` Drew Adams

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=m3d5l3bn0m.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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.