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

Re: Help with eql specializers



> From kanderso@DINO.BBN.COM Mon Jul 24 08:04:56 1989
> To: Daniel A Haug <aihaug@austin.lockheed.com>
> Cc: commonloops.pa@xerox.com, haug@austin.lockheed.com
> Subject: Re: Help with eql specializers 
> 
>   From: Daniel A Haug <aihaug@austin.lockheed.com>
>   Subject: Help with eql specializers
> 
>   [problem discussed here]
>   
> Can you extract a short example we can play with?  Off hand, i'd say
> that notice-methods-change... is only called when a generic function
> is invalidated.  It turns out that lots of unnecessary invalidation
> occurs when classes are defined.  However, i'm suprised that this
> happens when everything is loaded, and you are running a program.


This is pretty meaningless without all of the layered software to go
with it, but at least you can see that I'm not doing anything funny.
I timed the call from SMS-HANDLE-MAP-CLICK to HANDLE-VIEW-CONTEXT-CLICK.
This call either takes about 0.03 seconds, or around 6 seconds (measured
with TIME), depending on what happens with the invalidating of
generic functions.

;;;
;;; this method is called first...
;;;

(defmethod sms-handle-map-click ((rgi sms-rgi-mixin) args)
  "This is invoked in response to a map-background click:
-  The buffer contains the mouse-button (left,middle,right) that
-  was clicked"
  (let* ((mouse-int (first args))
	 (pixel-x (second args))
	 (pixel-y (third args))
	 (lat (fourth args))
	 (lon (fifth args))
	 (mouse-char (case mouse-int
		       (0 mouse-left)
		       (1 mouse-middle)
		       (2 mouse-right)))
	 (mouse-state (make-sms-mouse-state :button mouse-char
					    :position-x pixel-x
					    :position-y pixel-y
					    :lat lat
					    :lon lon))
	 (view-stack (sms-rgi-view-stack rgi))
	 (view (first view-stack)))
    ;;
    (handle-view-click-low view mouse-state)))


;;;
;;; which then calls this one...
;;;

(defmethod handle-view-click-low ((view view-context-mixin ) mouse-state)
  (handle-view-context-click view (first (view-context-stack view))
mouse-state))


;;;
;;; which will then call one of these three...
;;;

(defmethod handle-view-context-click ((view context-view) (context (eql
:first)) mouse-state)
  (declare (ignore mouse-state))
  (print 'at-first)
  (pop (view-context-stack view))
  (push :second (view-context-stack view)))


(defmethod handle-view-context-click ((view context-view) (context (eql
:second)) mouse-state)
  (declare (ignore mouse-state))
  (print 'at-second)
  (pop (view-context-stack view))
  (push :third (view-context-stack view)))


(defmethod handle-view-context-click ((view context-view) (context (eql
:third)) mouse-state)
  (declare (ignore mouse-state))
  (print 'at-third)
  (pop (view-context-stack view)))


=========================== end of example code =========================

Here are the methods that were in the environment at the time:

For SMS-HANDLE-MAP-CLICK:

(#<Standard-Method SMS:SMS-HANDLE-MAP-CLICK (SMS:SMS-RGI-MIXIN T)
440035435>)

For HANDLE-VIEW-CLICK-LOW:

(#<Standard-Method SMS:HANDLE-VIEW-CLICK-LOW (SMS:VIEW-CONTEXT-MIXIN T)
440030175>
 #<Standard-Method SMS:HANDLE-VIEW-CLICK-LOW (T T) 440035427>)

For HANDLE-VIEW-CONTEXT-CLICK:

(#<Standard-Method SMS:HANDLE-VIEW-CONTEXT-CLICK (T T T) 440035424>
 #<Standard-Method SMS:HANDLE-VIEW-CONTEXT-CLICK (RGT::SCENARIO-EDIT-VIEW

RGT::OBJECT-SELECTION-CONTEXT T) 362760325>
 #<Standard-Method SMS:HANDLE-VIEW-CONTEXT-CLICK (RGT::TEST-VIEW
RGT::TEST-CONTEXT T) 362652225>
 #<Standard-Method SMS:HANDLE-VIEW-CONTEXT-CLICK (SMS::CONTEXT-VIEW (EQL
:THIRD) T) 362452516>
 #<Standard-Method SMS:HANDLE-VIEW-CONTEXT-CLICK (SMS::CONTEXT-VIEW (EQL
:SECOND) T) 361041570>
 #<Standard-Method SMS:HANDLE-VIEW-CONTEXT-CLICK (SMS::CONTEXT-VIEW (EQL
:FIRST) T) 360451451>)


I can understand that as I am developing, and adding/changing classes
and methods, PCL must update everything.  So, I expect to pay hits
like this occasionally.  But, this problem persists, with repeated
mouse clicks, the same methods run over and over, without change.
And still, I get the 6-plus second delay.  I even rebooted and loaded
freshly compiled systems, and the problem did not go away.

I surely don't know enough PCL internals to tell that this is associated
with eql specializers.  All I know is that once I began to use them,
this problem started.

Okay, any suggestions again?

dan haug
Internet: haug@austin.lockheed.com
UUCP:     ut-emx!lad-shrike!aihaug