Article View: comp.lang.clos
Article #186Re: Slot access performance (was Re: Beginner's Question - CLOS)
From: Trent Lange
Date: Wed, 26 Aug 1992 07:14
Date: Wed, 26 Aug 1992 07:14
32 lines
2223 bytes
2223 bytes
In article <9208260507.AA05043@kuwait.lucid> jonl%kuwait@lucid.com (Jon L White) writes: > >But much more importantly is to look at SLOT-VALUE in an open-codable >context; Lucid's implementations show almost an order of magnitude >speed up over "naked slot value", and the 4.1 release even obeys all >the MOP'ish concerns. This context is usually (1) within the lexical >scope of a defmethod, (2) object is lexically recognizable as one of >the specialized parameters, and (3) slot name is compile-time constant. >[PCL used to have this sort of context-dependent optimization also, >but without the automated invalidation for MOP'ish concerns.] PCL still has this kind of context-dependent optimization. The new versions of PCL work the same as the old ones did, only with less runtime optimization overhead than before (and with MOP-required automated optimization invalidation as necessary). And fortunately for programmers using any version of CLOS, this open-codeable (and very fast) within-defmethod slot-value context is probably the most common usage, dramatically reducing any potential slot-access performance penalties CLOS implementations might face in comparison to implementations using structures. >Your numbers somehow don't seem to be consistent for this case -- >I get 173,913 on a Sparc2, where you get 35,000 on a Sparc1. The >two hardware platforms aren't _that_ much different, are they? Mea culpa. I had unequal compiler optimizations. With the highest compiler optimization settings, I get 89,000 on a Sparc1. Thanks for pointing out the error, and the reminder of the many pitfalls of benchmarking. - Trent Lange
Technical Details
Message-ID:
<1992Aug26.071425.6338@cs.ucla.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!news.claremont.edu!ucivax!ucla-cs!lanai.cs.ucla.edu!langeReferences:
<1992Aug26.011902.14530@cs.ucla.edu> <9208260507.AA05043@kuwait.lucid>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos Path: arc1-ca.pugleaf.net!sparky!uunet!news.claremont.edu!ucivax!ucla-cs!lanai.cs.ucla.edu!lange From: lange@lanai.cs.ucla.edu (Trent Lange) Subject: Re: Slot access performance (was Re: Beginner's Question - CLOS) Message-ID: <1992Aug26.071425.6338@cs.ucla.edu> Sender: usenet@cs.ucla.edu (Mr Usenet) Nntp-Posting-Host: lanai.cs.ucla.edu Organization: UCLA Artificial Intelligence Laboratory References: <1992Aug26.011902.14530@cs.ucla.edu> <9208260507.AA05043@kuwait.lucid> Date: Wed, 26 Aug 92 07:14:25 GMT Lines: 33