Optimizing closures in O(0) time

Optimizing closures in O(0) time
复制标题

在 O(0) 时间内优化闭包

DOI:
--
复制
发表时间:
2012
期刊:
Scheme and Functional Programming
影响因子:
--
通讯作者:
R. Dybvig
R. Dybvig
中科院分区:
--
文献类型:
--
作者:
Andrew W. Keep;Alex Hearn;R. Dybvig

文献摘要

被引文献

相似文献

用于表示一级过程的平闭包模型简单、空间安全且高效,允许使用单个内存间接访问自由变量的值或位置。它是一个程序员可以理解的简单模型,允许程序员预测程序的最坏情况。本文提出了一组优化,改进了平面闭包模型沿着的算法,实现它们,它表明,优化一起消除了超过50%的运行时闭包创建和自由变量访问的开销在实践中,与微不足道的编译时开销。这些优化不会增加开销并保持空间安全,从而保留了flat-closure模型的优点。
The flat-closure model for the representation of first-class procedures is simple, safe-for-space, and efficient, allowing the values or locations of free variables to be accessed with a single memory indirect. It is a straightforward model for programmers to understand, allowing programmers to predict the worst-case behavior of their programs. This paper presents a set of optimizations that improve upon the flat-closure model along with an algorithm that implements them, and it shows that the optimizations together eliminate over 50% of run-time closure-creation and free-variable access overhead in practice, with insignificant compile-time overhead. The optimizations never add overhead and remain safe-for-space, thus preserving the benefits of the flat-closure model.