Rust as a language for high performance GC implementation

    Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

    9 Citations (Scopus)

    Abstract

    High performance garbage collectors build upon performancecritical low-level code, typically exhibit multiple levels of concurrency, and are prone to subtle bugs. Implementing, debugging and maintaining such collectors can therefore be extremely challenging. The choice of implementation language is a crucial consideration when building a collector. Typically, the drive for performance and the need for efficient support of low-level memory operations leads to the use of low-level languages like C or C++, which offer little by way of safety and software engineering benefits. This risks undermining the robustness and flexibility of the collector design. Rust's ownership model, lifetime specification, and reference borrowing deliver safety guarantees through a powerful static checker with little runtime overhead. These features make Rust a compelling candidate for a collector implementation language, but they come with restrictions that threaten expressiveness and efficiency. We describe our experience implementing an Immix garbage collector in Rust and C. We discuss the benefits of Rust, the obstacles encountered, and how we overcame them. We show that our Immix implementation has almost identical performance on micro benchmarks, compared to its implementation in C, and outperforms the popular BDW collector on the gcbench micro benchmark. We find that Rust's safety features do not create significant barriers to implementing a high performance collector. Though memory managers are usually considered low-level, our high performance implementation relies on very little unsafe code, with the vast majority of the implementation benefiting from Rust's safety. We see our experience as a compelling proof-of-concept of Rust as an implementation language for high performance garbage collection.

    Original languageEnglish
    Title of host publicationISMM 2016 - Proceedings of the 2016 ACM SIGPLAN International Symposium on Memory Management, co-located with PLDI 2016
    EditorsChristine H. Flood, Zheng Zhang
    PublisherAssociation for Computing Machinery (ACM)
    Pages89-98
    Number of pages10
    ISBN (Electronic)9781450343176
    DOIs
    Publication statusPublished - 14 Jun 2016
    Event15th ACM SIGPLAN International Symposium on Memory Management, ISMM 2016 - Santa Barbara, United States
    Duration: 14 Jun 2016 → …

    Publication series

    NameInternational Symposium on Memory Management, ISMM
    Volume14-June-2016

    Conference

    Conference15th ACM SIGPLAN International Symposium on Memory Management, ISMM 2016
    Country/TerritoryUnited States
    CitySanta Barbara
    Period14/06/16 → …

    Fingerprint

    Dive into the research topics of 'Rust as a language for high performance GC implementation'. Together they form a unique fingerprint.

    Cite this