>>>>> "Jim" == Jim Newton <[EMAIL PROTECTED]> writes:

    Jim> here is the function which the profile seems to think
    Jim> allocates the most memory.  But i cannot see where it is
    Jim> allocating any memory at all.  Before i start ripping my
    Jim> program appart and changing defmethods to defuns am i reading
    Jim> the profile output completely wrong?  Or do i really need to
    Jim> be spending sunday afternoon in the park rather than in front
    Jim> of my computer?

    Jim> (defmethod get-square (( self board ) &key row col)
    Jim>   (declare (type fixnum row col))
    Jim>   (when (is-valid-square self :row row :col col)
    Jim>     (the square (aref (squares self) col row))))

Is the type square a class?

    Jim>  69,610,488 | 1,087,578 |     4.195 |   0.00000 |        64 |
    Jim> BLOCKER::GET-SQUARE
    Jim>                 685,542: NIL
    Jim>                 400,951: #<Code Object "DEFMETHOD GET-SQUARES (STATE)"
    Jim>                            {582D4257}>
    Jim>                     424: NIL
    Jim>                     248: NIL
    Jim>                     184: #<Code Object "DEFMETHOD COMPONENT-VALUE
    Jim> (GF-FREE-SQUARES)"
    Jim>                            {58430E17}>

64 bytes/call doesn't seem to much.  I assume the consing is coming
from having to box up the result of GET-SQUARE.

If this is really a problem, you can try to declare GET-SQUARE as an
inline function.  (Can't remember if that works for methods or not).

Ray


Reply via email to