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

Re: Help with eql specializers



I think i see what your problem is.

When you define a method, PCL invalidates the generic function.  The
next time you call that function, it gets rebuilt.  This makes the
first call very slow.  Subsequent calls are at full speed.  If you
redefine a class, many generic functions are needlessly invalidated,
including most of PCL.  I consider this a HUGE BUG, but haven't been
able to fix it permanently.  So if you change a class and a method,
the next you call the generic you must wait for it, and all of PCL to
be rebuilt.  So, when you do timing, throw away the first call:

(defun try (it N)
  (funcall it)
  (si:without-interrupts
   (time
    (dotimes (i N) (funcall it)))))