From xemacs-m  Wed Sep 24 15:35:44 1997
Received: from newman.aventail.com (root@newman.aventail.com [199.238.236.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id PAA03594
	for <xemacs-beta@xemacs.org>; Wed, 24 Sep 1997 15:35:36 -0500 (CDT)
Received: from kramer.in.aventail.com (wmperry@kramer.in.aventail.com [192.168.1.12])
	by newman.aventail.com (8.8.5/8.8.5) with ESMTP id NAA03905;
	Wed, 24 Sep 1997 13:35:24 -0700 (PDT)
Received: (from wmperry@localhost)
	by kramer.in.aventail.com (8.8.5/8.8.5) id NAA11901;
	Wed, 24 Sep 1997 13:32:54 -0700
To: Hrvoje Niksic <hniksic@srce.hr>
Cc: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: Slow glyphs
References: <kigg1quwmua.fsf@jagor.srce.hr>
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;
From: wmperry@aventail.com (William M. Perry)
Date: 24 Sep 1997 13:32:54 -0700
In-Reply-To: Hrvoje Niksic's message of "24 Sep 1997 21:09:17 +0200"
Message-ID: <86oh5i5u6h.fsf@kramer.in.aventail.com>
Lines: 36
X-Mailer: Quassia Gnus v0.9/XEmacs 20.3(beta23) - "Sarajevo"

Hrvoje Niksic <hniksic@srce.hr> writes:

> Has anyone else noticed how slow XEmacs redisplay is when the glyphs
> are to be presented in a buffer?  I am not talking about the creation
> of glyphs (`make-glyph' is not too slow), or about scralling or
> anything such -- the slowness is when the glyphs are to be *shown* for 
> the first time.
> 
> This is especially visible in Customize buffers, where the existence
> of graphical glyphs considerably slows down the display of the
> buffer.  For instance, when a too-screen long Customize buffer is
> created, it takes a second or two to display it (because of the
> glyphs).  When I press `next' to scroll a page down, I get the same
> second-or-two wait.  But then I can scroll up or down all I want, all
> the glyphs will be displayed quickly -- I suppose XEmacs caches them
> somehow.
> 
> Is there an explanation for this extraordinary slowness?  I am not
> familiar with that part of the code.

  I don't think the XImage is actually created until the glyph is shown for 
the first time.  make-glyph basically just caches all the data for various
device types internally, and then when the glyph is instantiated in a
particular buffer/frame/device/etc it actually gets decoded and turned
into an XImage.  Then it is cached for that locale.

  I used to have the PNG support show you any textual notes in the image,
but it would show them every time the image was instantiated, which at the
time seemed to be more often than I had expected.

  Try defining PNG_SHOW_COMMENTS in glyphs-x.c and you should see what I
mean. :)  Note that that code has never been tested very well - it has
never been defined for a beta of XEmacs, or on a machine other than linux,
and might not even work on newer versions of libpng.  Caveat builder.

-Bill P.

