Academia.eduAcademia.edu

Compact Encodings of List Structure

1979, ACM Transactions on Programming Languages and Systems

Abstract

List structures provide a general mechanism for representing easily changed structured data, but can introduce inefficiencies in the use of space when fields of uniform size are used to contain pointers to data and to link the structure. Empirically determined regularity can ...

Key takeaways

  • The list structures in existence at the end of a typical run of five large Lisp programs (about 50,000 cells each) were measured to determine the frequency of occurrence of pointer values in car (usually the data field) and cdr (usually the link field) of each list cell.
  • If the cdr field is only 2 bits wide, we can fit into the encoding just the two list offsets + 1 and -1, the atom NIL, and the escape.
  • This is, of course, due to the much greater regularity found in cdr; what especially hurts the car figures is the large number of pointers to a large number of atoms.
  • In this section we will argue that a fixed-width compact encoding of cdr will, as address space grows, accomodate a fraction of cdr pointers that is bounded from below by a nonzero constant.
  • Since cdr contains few pointers to atoms other than NIL, it is clear that there is a large benefit in encoding it.