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

incremental redisplay & storage allocation question



    Date: Tue, 28 Aug 90 18:24:45 PDT
    From: charest@ai-ganymede.JPL.NASA.GOV (Len Charest)

    One of our demo displays is implemented with presentations which may be
    updated about 10,000 times during the course of the demo (that is,
    incremental redisplay is performed often enough to cons up a total of
    10,000 new presentations). The display has about 50 visible
    presentations, which means that inc-redisplay is generating a lot of
    garbage.  The presentations in question are all compound graphical
    objects (i.e., their :printer uses several graphics:draw-xxx
    functions).

You might consider CLIM for your application instead of DW.  CLIM has been
designed with this need in mind, and the programmer has complete control
over as much of this part of the protocol as s/he wants.  The object put
into the output history just has to obey a small, well-defined and
well-documented protocol.

For example, we have a CAD demo program which manages its components as
presentations:

The basic presentation class:

  (defclass basic-thing ()
    ((x :initarg :x :accessor thing-x)
     (y :initarg :y :accessor thing-y)
     (size :initarg :size :accessor thing-size)))

  (defmethod clim:presentation-p ((thing basic-thing)) t)

  (defmethod clim:presentation-single-box ((thing basic-thing)) nil)

  (defmethod clim:displayed-output-record-element-p ((thing basic-thing)) t) 

  (defmethod clim:presentation-object ((thing basic-thing)) thing)


The display method for a presentation:
  (defmethod clim:replay ((gate or-gate) stream)
    ...)

The highlighting method for a presentation:
  (defmethod clim:highlight-output-record-1 ((gate basic-gate) stream state) 
    ...)


How your application matches (X,Y) into presentation objects:
  (defmethod clim:frame-find-presentation ((frame cad-demo) pane type x y continuation)
    ...)

[Of course, you could argue that some of these (e.g., everything on
BASIC-THING) ought to be packaged up into a mixin which CLIM provides, and
I think you would be right.]

Note that the opportunity to have to store your output history in any
manner you want.  The default FRAME-FIND-PRESENTATION method looks in the
output-history slot of the pane and searches that in the DW manner.  The
CAD-DEMO one searches its database of components and connections.  You
might imagine one in which the display phase of the user interface drew
representations of lots of objects which were not yet in virtual memory,
and only CONSed up the presentation object(s) when they were actually
referenced.