Autobahn: using genetic algorithms to infer strictness annotations

Autobahn: using genetic algorithms to infer strictness annotations
复制标题

Autobahn:使用遗传算法来推断严格性注释

DOI:
--
复制
发表时间:
2016
期刊:
ACM SIGPLAN Symposium/Workshop on Haskell
影响因子:
--
通讯作者:
Kathleen Fisher
Kathleen Fisher
中科院分区:
--
文献类型:
--
作者:
Y. Wang;Diogenes Nunez;Kathleen Fisher

文献摘要

被引文献

相似文献

尽管惰性可以带来漂亮的代码,但它也会带来不小的性能成本。 Haskell 的 ghc 编译器进行了优化来降低这些成本,但优化还不够。因此,Haskell 还提供了各种严格性注释,以便用户可以指示应立即计算表达式的程序点。熟练地使用这些注释是一门黑术,只有 Haskell 程序员专家才知道。在本文中,我们介绍了 AUTOBAHN,这是一种使用遗传算法自动推断严格注释的工具,可提高代表性输入的程序性能。用户检查建议注释的合理性,并可以指示 AUTOBAHN 自动生成修改后的源。对 NoFib 基准套件中的 60 个程序进行的实验表明,AUTOBAHN 可以推断注释集,从而将运行时性能提高几何平均值 8.5%。案例研究表明,AUTOBAHN 可以将 GC 模拟器的实际大小减少 99%,并为 Aeson 库代码推断应用程序特定的注释。 10 倍交叉验证研究表明,AUTOBAHN 优化的 GC 模拟器通常优于专家优化的版本。
Although laziness enables beautiful code, it comes with non-trivial performance costs. The ghc compiler for Haskell has optimizations to reduce those costs, but the optimizations are not sufficient. As a result, Haskell also provides a variety of strictness annotations so that users can indicate program points where an expression should be evaluated eagerly. Skillful use of those annotations is a black art, known only to expert Haskell programmers. In this paper, we introduce AUTOBAHN, a tool that uses genetic algorithms to automatically infer strictness annotations that improve program performance on representative inputs. Users examine the suggested annotations for soundness and can instruct AUTOBAHN to automatically produce modified sources. Experiments on 60 programs from the NoFib benchmark suite show that AUTOBAHN can infer annotation sets that improve runtime performance by a geometric mean of 8.5%. Case studies show AUTOBAHN can reduce the live size of a GC simulator by 99% and infer application-specific annotations for Aeson library code. A 10-fold cross-validation study shows the AUTOBAHN -optimized GC simulator generally outperforms a version optimized by an expert.