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

Re: size-of instance?



Try "time": I am not sure how the memory allocation reported compares
to that actually used by the instance but it in my experience it has
always seemed to be about right.

1 > (defclass foo (simple-view) ())
#<STANDARD-CLASS FOO>
1 > (time (make-instance 'foo))
(MAKE-INSTANCE 'FOO) took 73 milliseconds (0.073 seconds) to run.
Of that, 18 milliseconds (0.018 seconds) were spent in The Cooperative
Multitasking Experience.
 4648 bytes of memory allocated.
#<FOO #x1C32B81>

I can see how "time" might not have been the most likely candidate
for such a function in your eyes! Maybe they should have called it
"time-and-space", or how about "space-time", as in "the space-time
continuum"... ;-)

Hope this helps-

Ethan