Using Type Inference to Customize the Garbage Collector in an Object-Oriented Language. The SmallEiffel Compiler
Résumé
Although many garbage collection algorithms can be found in the literature, we think that the efficiency of a collector is closely linked to the quality of its implementation. This paper is not intended to present a new algorithm for garbage collection, but a way to optimize its implementation. In this paper we show how type inference information can help generating an efficient collector customized for each application. At compile time, SmallEiffel produces a mark-sweep collector tailored to the application. For example, the run through the object graph during the mark phase is hard coded thanks to the knowledge of object structure. In order to demonstrate our very good results, we also present a benchmark suite including typical execution patterns. The whole source code of the compiler itself is used as an additional real-size benchmark. We compare our results with two excellent production-level products. The technique we present is applicable to many kinds of collection algorithms, distributed or not.