From xemacs-m  Wed Jun 18 19:41:08 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id TAA01579
	for <xemacs-beta@xemacs.org>; Wed, 18 Jun 1997 19:41:06 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id CAA16292; Thu, 19 Jun 1997 02:41:06 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Very slow `make-face'?
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 19 Jun 1997 02:41:05 +0200
Message-ID: <kig205ztof2.fsf@jagor.srce.hr>
Lines: 47
X-Mailer: Gnus v5.4.52/XEmacs 20.3(beta7)

It seems to me that the `make-face' function is horribly slow.  For
example, I tried to examine why loading of hyper-apropos.elc goes so
slowly.  Here are the results of

(progn
  (start-profiling)
  (load "hyper-apropos")
  (stop-profiling))

Function                                               Count        %
---------------------------------------------------------------------
make-face                                                 89   41.395
(in garbage collection)                                   53   24.651
load-internal                                             21    9.767
add-spec-list-to-specifier                                17    7.907
define-key                                                 7    3.256
#<compiled-function (from \"keymap.elc\") (key binding) \"...(26)\" [binding olddef shadowing lookup-key keymap key define-key vconcat prefix newdef] 5>         6    2.791
string-match                                               3    1.395
copy-specifier                                             2    0.930
vconcat                                                    2    0.930
x-get-resource                                             2    0.930
face-property-instance                                     1    0.465
set-face-foreground                                        1    0.465
make-face-bold                                             1    0.465
device-type                                                1    0.465
lookup-key                                                 1    0.465
eval                                                       1    0.465
x-frob-font-weight                                         1    0.465
apply                                                      1    0.465
funcall                                                    1    0.465
custom-face-attributes-set                                 1    0.465
#<compiled-function (from \"faces.elc\") (sp locale inst-list func) \"...(45)\" [dfw-device locale device frob-face-property-1 sp inst-list func mapcar #<compiled-function (from \"faces.elc\") (device) \"...(7)\" [frob-face-property-1 sp device inst-list func] 5> device-list result nil new-result #<compiled-function (from \"faces.elc\") (arg) \"...(15)\" [arg new-result] 2> add-spec-list-to-specifier] 6>         1    0.465
redisplay-echo-area                                        1    0.465
canonicalize-inst-list                                     1    0.465


Discounting garbage-collection (which is also quite slow, but that's
another story), the time is obviously lost in `make-face'.  And
hyper-apropos.el doesn't even *have* that many faces.

Loading of gnus-cite.el is slow for similar reasons.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it."                                    -- Donald Knuth

