emacs-devel
[Top][All Lists]
Advanced

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

slow make-frame + face initialization / importing x resources


From: David Reitter
Subject: slow make-frame + face initialization / importing x resources
Date: Fri, 13 Jul 2007 18:55:49 +0100

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?




reply via email to

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