On Wed, Apr 16, 2003 at 11:22:59AM +0200, Antonio Martinez wrote:
> > The following patch modifies PROFILE so that it tries to use the
> > encapsulation facility provided in "fdefinition.lisp".
I have some reservations about that encapsulation facility. As in the
comments above FDEFINITION:
;;; KLUDGE: Er, it looks as though this means that
;;; (FUNCALL (FDEFINITION 'FOO))
;;; doesn't do the same thing as
;;; (FUNCALL 'FOO),
;;; and (SYMBOL-FUNCTION 'FOO) isn't in general the same thing
;;; as (FDEFINITION 'FOO). That doesn't look like ANSI behavior to me.
Until this is worked out somehow -- perhaps simply by deleting the
encapsulation facility:-| -- I'm not so enthusiastic about making
more code use it.
> Hmmmm. While running more stressful tests, it seems that profiling
> takes a lot longer with this patch. So I'm not sure this is ready for
> merging without more detailed testing.
Actually, I am myself also planning to patch PROFILE in a way which
will make it slower. In my profiling adventures today I discovered that
nonlocal exits make nonsense of the results. So (after a gentle reminder
from Dan Barlow about ANSI functionality) I now want to use UNWIND-PROTECT
to replace MULTIPLE-VALUE-PROG1. More consing, rah rah rah.
In my mind there's enough to be said for doing it right even if it's
slow that I think I'll just make the change in CVS despite the way
that the current implementation of UNWIND-PROTECT conses. However, it
might be that the overhead associated with this will be so
unreasonable that I'll end up undoing the change before 0.8.0.
> Meanwhile, while seeing how the encapsulation closure data could be
> integrated in profile-info, I've come across puzzling behaviour.
> The *enclosed-xxx* counters are seemingly of type pcounter or fixnums,
> yet *enclosed-consing* is used as an argument to fastbig-.
> Hypothetically, if this number ever overflowed and became a pcounter,
> the fastbig- would signal an error, because it would try to subtract
> a non-number. But it's a remote possibility, I admit.
For what it's worth, I got bitten by this today. On a modern computer
the possibility is insufficiently remote if one tries to profile a
function like ALPHA-BETA-SEARCH and let it run for a while. So I've
already hacked up a patch on my local machine and started playing with
it. More correctness fixes, rah rah rah.
So, thank you for the bug report and, despite my reservations above
about the ANSIness of encapsulated FDEFINITION, for the encapsulation
patch too. Maybe at some point encapsulation behavior will get
straightened out. (Not necessarily prompty, though. I've had a note on
the TODO list for over a year about how I think the TRACE and PROFILE
interfaces ought to be merged, and I still haven't done anything with it.)
William Harold Newman <william.newman@...>
When smashing monuments, save the pedestals -- they always come in handy.
-- Stanislaw Lem
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C