# HG changeset patch # User Paul Boddie # Date 1247177529 -7200 # Node ID 862f407f999c9d3d75ad919406b3b6227e1c69a6 # Parent af6a631171bcfceb26d2bb179030d1e7e95ca86b Added notes about matrix and list representations of the tables, along with a discussion of element sizes and fields. diff -r af6a631171bc -r 862f407f999c docs/concepts.txt --- a/docs/concepts.txt Sun Jun 21 02:02:53 2009 +0200 +++ b/docs/concepts.txt Fri Jul 10 00:12:09 2009 +0200 @@ -225,6 +225,42 @@ attrcode, uses-absolute-address, address (or location) +This could be given instead as follows: + + attrcode, is-class-or-module, location + +Since uses-absolute-address corresponds to is-class-or-module, and since there +is a need to test for classes and modules to prevent assignment to attributes +of such objects, this particular information is always required. + +Comparing Tables as Matrices with Displacement Lists +---------------------------------------------------- + +Although displacement lists can provide reasonable levels of compaction for +attribute data, the element size is larger than that required for a simple +matrix: the attribute code (attrcode) need not be stored since each element +unambiguously refers to the availability of an attribute for a particular +class or instance of that class, and so the data at a given element need not +be tested for relevance to a given attribute access operation. + +Given a program with 20 object types and 100 attribute types, a matrix would +occupy the following amount of space: + + number of object types * number of attribute types * element size + = 20 * 100 * 1 (assuming that a single location is sufficient for an element) + = 2000 + +In contrast, given a compaction to 40% of the matrix size (without considering +element size) in a displacement list, the amount of space would be as follows: + + number of elements * element size + = 40% * (20 * 100) * 2 (assuming that one additional location is required) + = 1600 + +Consequently, the principal overhead of using a displacement list is likely to +be in the need to check element relevance when retrieving values from such a +list. + Objects and Structures ======================