all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* slow make-frame + face initialization / importing x resources
@ 2007-07-13 17:55 David Reitter
  2007-07-13 23:08 ` Richard Stallman
  0 siblings, 1 reply; 19+ messages in thread
From: David Reitter @ 2007-07-13 17:55 UTC (permalink / raw)
  To: emacs- devel

I wonder if something can be done about the very slow `make-frame'.

Make-frame creates a frame-local copy of each face defined, and when  
you have a couple of faces defined for various modes, just a modest  
number of them (I have 700, defined with color-theme) will slow down  
frame creation to a point where it's just not tolerable any more.

Here's a bit of code to demonstrate the effect (with just "empty'  
faces):

(require 'cl)
(loop for X from 0 to 2000 do
       (make-face (intern (format "face%s" X))))
(let ((ti (current-time)))
   (loop for X from 0 to 10 do
	(make-frame))
   (print (format-time-string "%S" (time-since ti))))

The problem seems to be due to `x-create-frame-with-faces',  
specifically this form:

(dolist (face (delq 'default (face-list)))
       (condition-case ()
	  (progn
	    (face-spec-set face (face-user-default-spec face) frame)
	    (if (memq window-system '(x w32 mac))
		(make-face-x-resource-internal face frame))
	    (internal-merge-in-global-face face frame))
	(error nil)))

Frame creation time improves tremendously when I take out that call  
to `make-face-x-resource-internal'.
Is the import of x-resources necessary on Mac and Windows?
Also, is it necessary to do that every time a frame is created?  
Couldn't they be imported once at startup time?

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-07-16  3:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13 17:55 slow make-frame + face initialization / importing x resources David Reitter
2007-07-13 23:08 ` Richard Stallman
2007-07-14  1:21   ` Stefan Monnier
2007-07-14 22:32     ` Richard Stallman
2007-07-14  1:55   ` Stefan Monnier
2007-07-14 20:53     ` David Reitter
2007-07-14 21:28       ` Eli Zaretskii
2007-07-15  1:29         ` Stefan Monnier
2007-07-15 13:50           ` Jan Djärv
2007-07-15 14:07             ` David Kastrup
2007-07-15 22:02               ` Jan Djärv
2007-07-15 22:54             ` Richard Stallman
2007-07-15 22:53           ` Richard Stallman
2007-07-15  8:26         ` Juanma Barranquero
2007-07-15  9:35         ` David Reitter
2007-07-15 20:10           ` chad brown
2007-07-15 22:08             ` David Reitter
2007-07-16  1:40           ` Stefan Monnier
2007-07-16  3:19           ` Eli Zaretskii

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.