Counting immutable beans: reference counting optimized for purely functional programming

Sebastian Ullrich, L. D. Moura
{"title":"Counting immutable beans: reference counting optimized for purely functional programming","authors":"Sebastian Ullrich, L. D. Moura","doi":"10.1145/3412932.3412935","DOIUrl":null,"url":null,"abstract":"Most functional languages rely on some kind of garbage collection for automatic memory management. They usually eschew reference counting in favor of a tracing garbage collector, which has less bookkeeping overhead at runtime. On the other hand, having an exact reference count of each value can enable optimizations such as destructive updates. We explore these optimization opportunities in the context of an eager, purely functional programming language. We propose a new mechanism for efficiently reclaiming memory used by nonshared values, reducing stress on the global memory allocator. We describe an approach for minimizing the number of reference counts updates using borrowed references and a heuristic for automatically inferring borrow annotations. We implemented all these techniques in a new compiler for an eager and purely functional programming language with support for multi-threading. Our preliminary experimental results demonstrate our approach is competitive and often outperforms state-of-the-art compilers.","PeriodicalId":235054,"journal":{"name":"Proceedings of the 31st Symposium on Implementation and Application of Functional Languages","volume":"10 11","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-08-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"16","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 31st Symposium on Implementation and Application of Functional Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3412932.3412935","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 16

Abstract

Most functional languages rely on some kind of garbage collection for automatic memory management. They usually eschew reference counting in favor of a tracing garbage collector, which has less bookkeeping overhead at runtime. On the other hand, having an exact reference count of each value can enable optimizations such as destructive updates. We explore these optimization opportunities in the context of an eager, purely functional programming language. We propose a new mechanism for efficiently reclaiming memory used by nonshared values, reducing stress on the global memory allocator. We describe an approach for minimizing the number of reference counts updates using borrowed references and a heuristic for automatically inferring borrow annotations. We implemented all these techniques in a new compiler for an eager and purely functional programming language with support for multi-threading. Our preliminary experimental results demonstrate our approach is competitive and often outperforms state-of-the-art compilers.
计数不可变bean:为纯函数式编程优化的引用计数
大多数函数式语言都依赖于某种垃圾收集来实现自动内存管理。它们通常避免引用计数,而采用跟踪垃圾收集器,这样在运行时的簿记开销更少。另一方面,拥有每个值的精确引用计数可以实现诸如破坏性更新之类的优化。我们将在纯函数式编程语言的上下文中探讨这些优化机会。我们提出了一种新的机制来有效地回收非共享值使用的内存,减少对全局内存分配器的压力。我们描述了一种使用借用引用最小化引用计数更新数量的方法,以及一种自动推断借用注释的启发式方法。我们在一个支持多线程的纯函数式编程语言的新编译器中实现了所有这些技术。我们的初步实验结果表明,我们的方法具有竞争力,并且通常优于最先进的编译器。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信