17 Aug 11:14
unstable computing times with transient classes
From: Boris Smilga <agrostistenuis <at> yandex.ru>
Subject: unstable computing times with transient classes
Newsgroups: gmane.lisp.openmcl.devel
Date: 2008-08-17 09:17:13 GMT
Subject: unstable computing times with transient classes
Newsgroups: gmane.lisp.openmcl.devel
Date: 2008-08-17 09:17:13 GMT
Hello. I would like to ask a question concerning the inner workings of CCL, which was prompted by the following events. I was recently experimenting with transient object classes, i.e. classes which are created dynamically and exist only as long as they have instances. (This has some affinity with how prototype-based object systems work.) One evident approach here is to create anonymous classes using (MAKE-INSTANCE 'STANDARD-CLASS) and operate on them using MOP capabilities. What I found out, however, was that this approach has serious performance issues. To abstract away unnecessary details, I conducted the following experiment: 1. Generate a grove, G, which is a list of conses (KEY . VALUE) where KEYs are symbols and VALUEs are either strings or nested groves. A good size of groves for our purposes would be in the thousands of nodes. 2a. For G (and, recursively, for each of its subgroves), create C: an anonymous STANDARD-CLASS whose DIRECT-SLOTS are named after G's KEYs and which is a subclass of STANDARD-OBJECT. 2b. Do (REMOVE-DIRECT-SUBCLASS (FIND-CLASS 'STANDARD-OBJECT) C), so that DIRECT-SUBCLASSES of STANDARD-OBJECT do not bloat. 2c. Create an instance of C and set its slots to the VALUEs consed on G's respective KEYs. 3. Repeat steps 2a-2c several times (for the same G), measuring the runtime. The Lisp code for the experiment and the transcript are attached herewith. To summarize, the runtimes were extremely unstable, rising from 1½ sec. on the 1st iteration to 49 sec. on the 16th, then quickly dropping to 7 sec. and rising again, and so on. (I have run the test in Darwin console mode to exclude that other software appropriates processing cycles; and it doesn't look like the time was being spent on GC.)(Continue reading)
RSS Feed