Rust as a language for high performance GC implementation

Rust as a language for high performance GC implementation
复制标题

DOI:
10.1145/2926697.2926707
复制
发表时间:
2016-06
期刊:
Proceedings of the 2016 ACM SIGPLAN International Symposium on Memory Management
影响因子:
--
通讯作者:
Yi Lin;S. Blackburn;Antony Hosking;Michael Norrish
Yi Lin;S. Blackburn;Antony Hosking;Michael Norrish
中科院分区:
其他
文献类型:
--
作者:
Yi Lin;S. Blackburn;Antony Hosking;Michael Norrish

文献摘要

被引文献

相似文献

高性能垃圾收集器以性能至关重要的低级代码为基础,通常表现出多种级别的并发性,并且容易出现微妙的错误。因此,实施,调试和维护此类收藏家可能极具挑战性。实施语言的选择是建立收藏家时的关键考虑。通常,性能的驱动力和有效支持低级内存操作的需求会导致使用低级语言(例如C或C ++),这些语言几乎没有通过安全和软件工程的好处提供。这有可能破坏收藏家设计的鲁棒性和灵活性。 Rust的所有权模型,终身规范和参考借贷通过强大的静态检查器提供安全保证,而运行时很少。这些功能使Rust成为收藏家实施语言的引人注目的候选人,但它们具有威胁表达和效率的限制。我们描述了在Rust和C中实施Immix垃圾收集器的经验。我们讨论了Rust的好处,遇到的障碍以及我们如何克服它们的好处。我们表明,与其在C中的实施相比,我们的Immix实施在微观基准上几乎具有相同的性能,并且在GCBENCH微型基准测试中胜过流行的BDW收集器。我们发现Rust的安全功能并没有为实施高性能收集器带来重大障碍。尽管通常认为记忆经理人是低级的,但我们的高性能实施依赖于很少的不安全代码,绝大多数实施都从RUST的安全性中受益。我们将我们的经验视为对RUST的引人注目的概念证明,是一种用于高性能垃圾收集的实施语言。
High performance garbage collectors build upon performance-critical 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.