Performance and Evaluation of Lisp Systems
Total Page:16
File Type:pdf, Size:1020Kb
Performance and Evaluation of Lisp Systems Richard P. Gabriel Originally Published by The MIT Press in their Computer Systems Series (ISBN 0-262-07093-6) Preface The distance is commonly very great between actual performances and speculative possibility, It is natural to suppose that as much as has been done today may be done tomorrow: but on the morrow some difficulty emerges, or some external impediment obstructs. Indolence, interrup- tion, business, and pleasure, all take their turns of retardation; and every long work is lengthened by a thousand causes that can, and ten thousand that cannot, be recounted. Perhaps no extensive and multifarious per- formance was ever effected within the term originally fixed in the under- taker’s mind. He that runs against Time has an antagonist not subject to casualties. Samuel Johnson (Gibbon’s Miscellaneous Works) When I ran across this quote, I was at first jubilant to have found something profound about performance written by Samuel Johnson which I could use as a centerpiece for the preface to this book. But as I read I saw that he was talking much too specifically about human performance to be an appropriate general statement about performance—a statement that could be applied to the performance of a computer program. It took me a few days to see that the point Johnson made addressed the very center of what should be learned about the performance of Lisp systems by anyone who cares to study the material I’ve presented in this book. That point is that people work very hard to attain every microsecond of speed that a computer demonstrates, and there are two major problems facing an implementor when he embarks on producing a Lisp system: the first problem is the myriad of decisions to be made, the interactions of various parts of the Lisp system when they are brought together, the unfortunate choice in one aspect of the system turing around and influencing, badly, the performance of another; the second problem is that writing a Lisp system is a monumental undertaking, and this undertaking is executed within the context of living a life as well. And, although an implementor might start out with large goals and spectacular intentions, the time it takes to do the thorough job required to produce an excellent Lisp system will bring many obstacles and intrusions, impediments and obstructions, and in the end, Time will have won out, in that every microsecond the implementor grabs from the hands of Time are bought with hours or days or weeks or months of effort expended by the implementor. ii When I began the adventure on which I am reporting in this book, I had the belief that I would simply gather benchmark programs, distribute them to a hand- ful of implementors, and get back the results; my major job would be to distribute the results to all interested parties. When I first sent out the initial benchmarks, there was an uproar because the benchmarks weren’t fair, they weren’t representa- tive of real Lisp programs, people didn’t care about performance now so why bring up this minor concern as a major one, and what was I trying to do, embarrass one group of implementors for the benefit of others? Throughout the adventure, which lasted four years, I was praised for perform- ing a public service, I was praised for helping find performance and correctness bugs, I was praised for taking the lead in a necessary area—gathering accurate and objective performance information—where others would fear to tread or would be too burdened to tread; and I was accused of favoritism, accused of industrial espi- onage, even a computer account was closed while I was using it because a system administrator was told that I was possibly gathering proprietary information. Some people requested that this book not contain any charts, but that the benchmark results be included in running text, the idea being that it would take a significant effort on the part of a reader to make a chart of his own. But despite the extremes of reaction to my activities, the most common reaction was for the Lisp implementor to look at the results he got running my benchmarks compared with the results from other Lisp implementations, and to turn, quietly and patiently, to his terminal to improve the results. Over the course of the four-year study I’ve watched the performance of some Lisp systems improve by factors of up to four on some benchmarks, and by factors of two and three overall. These results took the full four years to achieve in some cases, and I think it was the existence of a widely available, common set of benchmarks along with the results of those benchmarks for a number of Lisp implementations that have contributed to these improvements. It is a gift to be born beautiful or rich or intelligent, to be given, by birth, the possibilities of excellent education, to be endowed with gifts that allow one to make important and stunning contributions. And I respect those individuals who use their talents when those talents have been cultivated ‘in the usual manner.’ But I admire, much more, people who are born ugly or poor or of average intel- ligence, who have minimal opportunities for first-class education, who work their iii ways through bad schools and bad breaks to make contributions. Perhaps the contributions are less important or less frequent than from those who are blessed, but the contributions are the result of a strong will and advantageous application of available talent and skills. And so it is with the performance of Lisp systems: I respect the performance of Lisp systems based on special hardware designed by wizards, but I admire the performance of Lisp systems on stock hardware and written by the common implementor, especially when I’ve watched the performance of those latter systems creep up over the years, by small increments, and accomplished during periods of busy activity in other areas. Acknowledgements This book is really the confluence of works and results provided to me by many people: I did not run every benchmark reported here, I did not write every benchmark, and I did not create every section of this book. However, I gathered the raw material together and unified it into a book. The sections describing the various implementations was written based on information provided to me by the implementors of those systems. In these acknowledgements I hope to credit as accurately as I can remember those people who did most of the work reported here. L. Peter Deutsch got the project started by turning a simple suggestion by me for a methodology into a statement of volunteering. Early comments, crit- icisms, benchmarks, and benchmark results were provided by Charles Hedrick, Mabry Tyson, Paul Martin, Gerrold Ginsparg, Jon L. White, Richard Fateman, and Larry Masinter. Larry Masinter and I wrote a paper, entitled ‘Performance of Lisp Systems,’ which was presented at the 1982 ACM Symposium on Lisp and Functional Programming, and which is largely reproduced, with revision, in Chapter 1. Bob Boyer, Harry Barrow, and Richard Fateman contributed three of the more important benchmarks contained herein: BOYER, FFT, and FRPOLY. Forest Baskett wrote, for another context, PUZZLE. Larry Masinter contributed TAKL and TAKR. John McCarthy’s bad memory was responsible for TAK. The material for the sections on the Symbolics Lisp machines and the CADR was put together by Paul Wieneke, working from Symbolics and MIT documents, and the material on the instruction fetch unit was provided by Bruce Edwards; the material for the LMI section was contributed by Morris (Mache) Creeger of Lisp Machines Inc.; the S-1 Lisp section is an adaptation of a paper presented at the 1982 ACM Symposium on Lisp and Functional Programming written by Guy L. Steele Jr., Rod Brooks, and myself; the material for the Franz section was con- tributed by John Foderaro and Richard Fateman; the material for the NIL section was contributed by Glenn Burke; the material for Spice section was contributed by Skef Wholey; the material for the Vax Common Lisp section was contributed by Walter van Roggen; the material for the PSL section was contributed by Robert Kessler, Martin Griss, and Jim McDonald; the material for the Xerox section was contributed by Jon L White and Larry Masinter; and the material for the Data General section was contributed by Dan Oldman. v The following people ran benchmarks and provided a great deal of support and information about the benchmark results: Raymond Bates, Alan Bawden, Eric Benson, Bob Boyer, Rod Brooks, Gary Brown, Howard Cannon, George Carrette, Scott Fahlman, Mike Farmwald, William Galway, Jim Gay, Erik Gilbert, Joe Ginder, Bernie Greenberg, Richard Greenblatt, Carl W. Hoffman, Earl Killian, Paul Martin, Dave Moon, Vaughan Pratt, Tom Rindfleisch, Eric Schoen, Beau Sheil, Guy L. Steele, Jr., Bill vanMelle, and Dan Weinreb. Virginia Kean did a major editing job on this book. — R. P. G. Palo Alto, California May 1985 Contents Chapter 1 Introduction . 1 1.1 Levels of Lisp System Architecture . 2 1.2 Lisp Operation Level . 18 1.3 Major Lisp Facilities . 20 1.4 The Art of Benchmarking . 23 Chapter 2 The Implementations . 31 2.1 MacLisp . 31 2.2 MIT CADR . 34 2.3 Symbolics . 36 2.4 LMI Lambda . 42 2.5 S-1 Lisp . 46 2.6 Franz Lisp . 51 2.7 NIL . 54 2.8 Spice Lisp . 58 2.9 Vax Common Lisp . 63 2.10 Portable Standard Lisp . 66 2.11 Xerox D-Machine . 73 Chapter 3 The Benchmarks .