请输入您要查询的百科知识:

 

词条 CDR coding
释义

  1. External links

{{No footnotes|date=October 2011}}

In computer science CDR coding is a compressed data representation for Lisp linked lists. It was developed and patented by the MIT Artificial Intelligence Laboratory, and implemented in computer hardware in a number of Lisp machines derived from the MIT CADR.

CDR coding is in fact a fairly general idea; whenever a data object A ends in a reference to another data structure B, we can instead place the structure B itself there, overlapping and running off the end of A. By doing this we free the space required by the reference, which can add up if done many times, and also improve locality of reference, enhancing performance on modern machines. The transformation is especially effective for the cons-based lists it was created for; we free about half of the space for each node we perform this transformation on.

It is not always possible to perform this substitution, because there might not be a large enough chunk of free space beyond the end of A. Thus, some objects will end in a real reference, and some with the referenced object, and the machine must be able to tell by reading the final cell which one it is. This can be accomplished with some inefficiency in software by the use of tagged pointers, which allow a pointer in a final position to be specifically tagged as such, but is best done in hardware.

In the presence of mutable objects, CDR coding becomes more complex. If a reference is updated to point to another object, but currently has an object stored in that field, the object must be relocated, along with any other pointers to it. Not only are such moves typically expensive or impossible, but over time they cause fragmentation of the store. This problem is typically avoided by using CDR coding only on immutable data structures.

Unrolled linked lists are simpler and often higher-performance than CDR coding (no "tagged pointers"; typically less fragmentation).{{Citation needed|date=December 2011}} For short lists, CDR coding uses the least amount of space.

External links

  • {{cite web | editor1 = Mark Kantrowitz | editor2 = Barry Margolin | url = http://www.faqs.org/faqs/lisp-faq/part2/section-9.html | work = FAQ: Lisp Frequently Asked Questions | title = (2-9) What is CDR-coding? | publisher = Advameg, Inc. | accessdate = 2011-10-09 }}
  • {{cite book | first = John | last = Allen | title = The Anatomy of Lisp | publisher = McGraw-Hill | date = 1978 }}
{{compu-prog-stub}}

2 : Lisp (programming language)|Data compression

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/23 22:25:59