From xemacs-m  Sun Jan 12 16:07:11 1997
Received: from xemacs.cs.uiuc.edu (localhost [127.0.0.1])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id QAA01670; Sun, 12 Jan 1997 16:07:11 -0600 (CST)
Message-Id: <199701122207.QAA01670@xemacs.org>
To: David Moore <dmoore@UCSD.EDU>
cc: XEmacs Beta Mailing List <xemacs-beta@xemacs.org>
Subject: Re: hanoi and other display slowness 
In-reply-to: Your message of "12 Jan 1997 11:13:50 PST."
             <rvhgkmhfkh.fsf@sdnp5.ucsd.edu> 
Date: Sun, 12 Jan 1997 16:07:09 -0600
From: Chuck Thompson <cthomp@xemacs.org>

    David> I haven't looked in the display code before... so is it
    David> possible to make runes be a sharable item, such that every
    David> instance of the same rune in a display shares the same
    David> structure?  Then the compare_runes check could be short
    David> circuited with a simple == pointer check.  Currently the
    David> hanoi testing never calls compare_rune with two == values.
    David> And maybe add_emchar_rune is just being called too much as
    David> well.

Interesting idea but it won't work.  It will eliminate information
needed for some other optimizations and you will also mostly end up in
a pay me now or pay me later situation.  add_emchar_rune would end up
having to do most of the comparisons you are trying to eliminate in
order to determine whether the same structure can be used.

It is unlikely that you can eliminate many additional calls to
add_emchar_rune.  There might be a way to really improve the
performance of compare_runes and compare_display_blocks.  As an added
bonus the additional work is what is needed to fix the tty performance
problems.  The cost is an increase in the size of the redisplay
structures though probably not a dramatic one.

Add hash values for each characters and then based on those for the
line.  You then do the initial comparison using those values and that
allows you to potentially short circuit a lot of lower level checks.
There are lots of low-level issues but that is the basic idea.


			-Chuck

