Programmers using native languages such as C, C++, or Rust can implement custom memory allocation strategies to improve execution time. In their paper titled "Reconsidering Custom Memory Allocation" almost 25 years ago, Berger et al. showed that while per-class allocators provide no significant speedups over a state-of-the-art general-purpose allocator, region-based allocators can improve execution time by allocating and freeing objects in bulk. This paper revisits that work on a modern hardware platform with modern general-purpose allocators to evaluate whether their conclusions still hold. It also augments the benchmark suite with two large real-world applications (Clang and Blender), and introduces a methodology to explore the effect of memory fragmentation on locality in general-purpose allocators. Our results support and extend the original conclusions, demonstrating the locality advantages of region-based custom memory allocators.
翻译:使用C、C++或Rust等原生语言的程序员可以通过实现自定义内存分配策略来缩短执行时间。大约25年前,Berger等人在其题为“重新审视自定义内存分配”的论文中指出,虽然基于类的分配器相较于最先进的通用分配器无法提供显著的加速效果,但基于区域的分配器能够通过批量分配和释放对象来改善执行时间。本文在现代硬件平台上,采用现代通用分配器重新审视该研究成果,以评估其结论是否仍然成立。此外,本文扩展了基准测试套件,增加了两个大型真实应用(Clang和Blender),并引入了一种方法来探索通用分配器中内存碎片对局部性的影响。我们的研究结果支持并扩展了原结论,证明了基于区域的自定义内存分配器在局部性方面的优势。