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

Re: size-of instance?



In article <v01510102abdfd152c48a@[204.253.24.159]> missing@inch.com (Ken Tilton) writes:

   Path: info-server.bbn.com!news2.near.net!services.cambridge.apple.com!newsgate!inch.com!missing
   From: missing@inch.com (Ken Tilton)
   Newsgroups: comp.lang.lisp.mcl
   Date: 17 May 1995 12:47:27 -0400
   Organization: Apple
   Lines: 30
   Sender: daemon@news.cambridge.apple.com
   NNTP-Posting-Host: services.cambridge.apple.com
   Mime-Version: 1.0
   Content-Type: text/plain; charset="us-ascii"

   >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.
   >


   It *does* seem to give meaningful results. Thanks. But I was getting some
   funny results, so there *is* at least one minor caveat: do the measurement
   twice!

   Your example came out at 4648. I got the same result the first time. The
   second time it comes out 40!

   I also note that changing a class causes a big hit the first time I
   measure, so a second measure is needed.

CLOS is lazy.  When you change a class or a method, say, it does some work
may do more work the first time you create an instance or call a generic.

Also, be sure that make-instance isn't consing anything besides the
instance who's size you are trying to measure.

   So I guess the good news is #'time may serve the purpose, and the bad news
   is, it (naturally) is not directly measuring the object, soo...?

   Anyway, my little objects don't look too big (if the second answer is
   correct!) so on I go with CLOS.

   But I think I will pass on mixing in simple-view for each character (my
   original concern) because of the *code* (and thus performance) overhead!

   Thanks again.

   To Digitool--how about a size-of function?


--
Ken Anderson 
Internet: kanderson@bbn.com
BBN ST               Work Phone: 617-873-3160
10 Moulton St.       Home Phone: 617-643-0157
Mail Stop 6/4a              FAX: 617-873-2794
Cambridge MA 02138
USA