freenode/#sbcl - IRC Chatlog
Search
12:14:59
stassats
ok, why is there a t16 in the first place, it's (let ((z (if m 10 20)))) why isn't 10/20 moved to Z, but through t16
12:16:05
stassats
tried to improve the debug information generated from &key, and there's so many things
13:18:28
stassats
i can avoid creating that "t16" during ltn annotation, but i'm sure it'll break something in stack analysis
14:02:24
phoe
I have a weird case where defining methods like (defmethod ensure-class-using-class ((class (eql (find-class 'fred2))) (name (eql 'asdfg2)) &key) nil) becomes progressively slower over time with 100% CPU usage.
14:13:32
phoe
I'll first double-check if I'm using ENSURE-CLASS-USING-CLASS correctly or if I am not screwing something up.
14:29:21
pfdietz
I just wrote a simple benchmark that defines a bunch of EQL methods, then repeated invokes the function with the various values in the EQL specifiers. The time (for invoking the function, not including method definitions) does scale superlinearly.
14:34:29
pfdietz
When I pull out a loop to invoke the methods on all the EQL parameters, the subsequence executions are fast. I assume loading the dispatch hash table (it uses that, right?) is the slow part.
14:34:37
phoe
I've noticed it because if I run the tests for a library I'm writing first time, they finish in under a 1/10 second.
14:37:25
phoe
My method attempts to remove itself via REMOVE-METHOD after being called. It's a trick I'm using.
14:37:48
phoe
I define a method that calls REMOVE-METHOD + FIND-METHOD on its own specializers and qualifiers.
14:39:20
pfdietz
I wonder if REMOVE-METHOD will work properly when called on a method that is currently active.
14:50:24
pfdietz
I mean, do the objects they get specialized on go away, but the method stay around?
14:51:52
phoe
Yes, I'll need some time. I'm still working on my test case, narrowing down my library code to something that still exhibits this behavior.
14:55:09
pfdietz
If that is the problem, you can manually run down that list, identify the dead methods yourself, and remove them.
14:56:26
phoe
Even though the classes themselves are removed, via SETF FIND-CLASS NIL, the eql-specializers seem to stay.
15:05:50
stassats
somehow using LET tns before doing a let-call screws up in cold-init, yet none of the tests fail
15:15:16
stassats
i guess not using intermediates for LET is a bit futile (stack analysis doing its own thing and whatnot) and copyprop does handle it
15:19:21
stassats
cause i can't see how you can call remove-method and not end up with a removed method
15:19:56
pfdietz
I think these methods remove themselves if they are called. The issue is the ones not being called.
15:26:18
phoe
No referenced instances of the class exist, the class itself isn't referenced from anywhere else - I guess the method would be garbage-collected as well if the class it is specialized on is otherwise inaccessible.
15:26:58
phoe
The only instance, I guess, is the prototype, but that's referenced from the class object itself only.
15:29:09
pfdietz
What one would want, would be that a method with an EQL specializer on an otherwise dead object should be GCed. And I doubt that's happening.
15:33:04
scymtym
even after (setf (find-class …) nil), the class would still be a direct-subclass of something. can't make all that weak
15:33:23
phoe
I can no longer call a method if the class it specializes on is otherwise inaccessible, unless I invoke some MOP magic.
15:36:18
phoe
So basically, it is up to the programmer to ensure that all classes/methods are properly disposed of.
16:04:59
flip214
phoe: running something _once_ each time a class is redefined -- why not use UPDATE-INSTANCE-FOR-REDEFINED-CLASS and check some class-static slot for the right version or so?
18:15:58
stassats
writing directly into the correct is probably a better idea, i guess i'll have to do that and wait for pfdietz to break that
18:56:18
stassats
and i've confused myself sufficiently by pulling on all the threads at once that i can't fulfill a single objective
20:02:51
stassats
ok, at least (defun bar (&key (x 10)) (declare (optimize (debug 1))) (break) (print x)) now shows X and not DEFAULTING-TEMP
20:16:24
pfdietz
I wrote a targeted random tester for TYPEP on integer types. No more failures found.
20:36:31
Xof
if you believe in the mop, you believe in the ability to define an anonymous subclass with no instances, and yet be able to find it later with class-direct-subclasses
20:44:36
stassats
i wonder if just using SETF instead of calling functions for &keyword processing will solve all my worries