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

are dynamic windows really 60X slower than old windows?!



    Date: Tue, 28 Feb 89 16:45:45 EDT
    From: cogen@XN.LL.MIT.EDU (David Cogen)

    I measured the time to do draw 240 rectangles (with :DRAW-RECTANGLE) and 80
    strings (with :DRAW-STRING) to a DW:DYNAMIC-WINDOW. It took 20 seconds!

    Then I did the same thing to a TV:WINDOW. It took .35 seconds.

    Could dynamic windows really be that slow? Surely not possible. I must be doing
    something wrong. Is there a trick to bring graphics speed to a dynamic window to
    at least within a factor of 2 of a static window?

I wasn't able to duplicate your results. If you don't care about output history,
the macro dw:with-output-recording-disabled may be of interest. Your mileage may vary.

Mark.

(defun draw-it-dw ()
  (let ((window (tv:make-window 'dw:dynamic-window :edges-from :mouse)))
    (send window :expose)
    (time
      (progn (loop repeat 240
		   do (send window :draw-rectangle 20 20 50 50))
	     (loop repeat 80
		   do (send window :draw-string "hi mom" 20 20))))))

(defun draw-it-dw-no-history ()
  (let ((window (tv:make-window 'dw:dynamic-window :edges-from :mouse)))
    (send window :expose)
    (time
      (dw:with-output-recording-disabled (window)
	(progn (loop repeat 240
		     do (send window :draw-rectangle 20 20 50 50))
	       (loop repeat 80
		     do (send window :draw-string "hi mom" 20 20)))))))

(defun draw-it-tv ()
  (let ((window (tv:make-window 'tv:window :edges-from :mouse)))
    (send window :expose)
    (time
      (progn (loop repeat 240
		   do (send window :draw-rectangle 20 20 50 50))
	     (loop repeat 80
		   do (send window :draw-string "hi mom" 20 20))))))

(defun run-test ()
  (format t "~%Data for DW~%")
  (draw-it-dw)
  (format t "~%Data for DW not recording history~%")
  (draw-it-dw-no-history)
  (format t "~%Data for TV~%")
  (draw-it-tv))

->  (run-test)
Data for DW
Evaluation of (PROGN (LOOP REPEAT 240 DO #) (LOOP REPEAT 80 DO #)) took 1.325577 seconds of ela
psed time including:
  0.014 seconds processing sequence breaks,
  0.026 seconds in the storage system (including 0.000 seconds waiting for pages):
    0.005 seconds processing 27 page faults including 0 fetches,
    0.020 seconds in creating and destroying pages, and
    0.000 seconds in miscellaneous storage system tasks.
1,840 list, 404 structure words consed in WORKING-STORAGE-AREA.
5,440 structure words consed in *PRESENTATION-AREA*.

Data for DW not recording history
Evaluation of (DW:WITH-OUTPUT-RECORDING-DISABLED (WINDOW)
                (PROGN # #)) took 0.660203 seconds of elapsed time including:
  0.008 seconds processing sequence breaks,
  0.001 seconds in the storage system (including 0.000 seconds waiting for pages):
    0.001 seconds processing 5 page faults including 0 fetches,
    0.000 seconds in creating and destroying pages, and
    0.000 seconds in miscellaneous storage system tasks.

Data for TV
Evaluation of (PROGN (LOOP REPEAT 240 DO #) (LOOP REPEAT 80 DO #)) took 0.397418 seconds of ela
psed time including:
  0.005 seconds processing sequence breaks,
  0.000 seconds in the storage system (including 0.000 seconds waiting for pages):
    0.000 seconds processing 5 page faults including 0 fetches,
    0.000 seconds in creating and destroying pages, and
    0.000 seconds in miscellaneous storage system tasks.