freenode/#sicl - IRC Chatlog
Search
5:00:57
drmeister
I've converted a lot of (typep x '<cleavir-class>) to class-predicates. I've gotten a lot more parallelism out of compile-file-parallel - but there are still find-class invocations taking place.
5:05:13
drmeister
(make-instance (let ((x (load-time-value (list nil)))) (or (car x) (car (rplaca x (find-class 'context))))) ...)
5:13:29
no-defun-allowed
What does that do? It looks something like giving make-instance the class object at load time, with a useless cons thrown in.
5:14:33
drmeister
It allocates a cons cell at load time and the first time it evaluates it calls find-class and stuffs it into the car of the cons cell. Every time after that it returns the class by pulling it out of the car of the cons cell.
5:15:59
drmeister
WIth just (make-instance 'foo ...) that becomes (make-instance (find-class 'foo) ...) and find-class needs to be evaluated every time.
5:21:35
beach
drmeister: I don't think that should be something to do in Cleavir, but in your implementation of MAKE-INSTANCE.
6:02:01
beach
SICL (and therefore Cleavir) is largely about making the code look "natural" (I should use a better term, but I haven't decided which one is best), and to make that "natural" looking code efficient (sometimes even effective) using other means. The entire bootstrapping procedure can be seen as a giant exercise in this direction. I mean, (defclass t () () (:metaclass built-in-class)) and other similar constructs are perfect examples of
6:04:13
beach
Well, I haven't thought it through very carefully, but it seems to me it would be possible.
6:04:49
beach
You can even compile those as special operators if that is more convenient than a compiler macro.
6:05:52
beach
I might do something like that for SICL, since scymtym pointed out the idea of using "cells" for the class database, in addition to the function database that I already use it for in SICL.
6:08:05
beach
Probably FIND-CLASS to start with, assuming that MAKE-INSTANCE with a symbol argument calls FIND-CLASS.
6:15:45
beach
For ordinary function calls with in source code like (f ...), SICL customizes Cleavir to do something like (funcall (car (load-time-value (sicl-genv:function-cell 'f))) ...) but I don't make that explicit in Cleavir itself. This situation seems similar.
6:17:08
beach
That's a very general question. I haven't thought of all aspects of threads. But I think I figured out what to do with the garbage collector.
6:17:36
beach
I am not planning to do parallel compilation any time soon, so I won't have the performance problems you do (or did).
6:18:12
beach
Aside from GC, I have given thought to updating instances and adjusting arrays in the presence of threads.
6:20:46
beach
In general, I don't think I need to think as much about compile-time performance for SICL as you seem to have to think about for Clasp. Mainly since I don't bootstrap the way you do.