Stream fusion, to completeness

Stream fusion, to completeness
复制标题

流融合,完整

DOI:
10.1145/3009837.3009880
复制
发表时间:
2016
期刊:
Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages
影响因子:
--
通讯作者:
Y. Smaragdakis
Y. Smaragdakis
中科院分区:
--
文献类型:
--
作者:
O. Kiselyov;Aggelos Biboudis;Nick Palladinos;Y. Smaragdakis

文献摘要

被引文献

相似文献

流处理是主流的(再次):从Java到C#再到Scala再到Ocaml到Haskell,可以使用广泛使用的流库。精选的Java 8流不支持拉链运算符,并且与手写的循环相比,我们提出了第一个代表流程处理的通用性,并消除了台阶基于流的异常语义模型。流式的差异和“ for”和“ while”循环的选择。提供最高的,保证的和便携式的性能。 JVM,通过LMS上演。 。
Stream processing is mainstream (again): Widely-used stream libraries are now available for virtually all modern OO and functional languages, from Java to C# to Scala to OCaml to Haskell. Yet expressivity and performance are still lacking. For instance, the popular, well-optimized Java 8 streams do not support the zip operator and are still an order of magnitude slower than hand-written loops. We present the first approach that represents the full generality of stream processing and eliminates overheads, via the use of staging. It is based on an unusually rich semantic model of stream interaction. We support any combination of zipping, nesting (or flat-mapping), sub-ranging, filtering, mapping—of finite or infinite streams. Our model captures idiosyncrasies that a programmer uses in optimizing stream pipelines, such as rate differences and the choice of a “for” vs. “while” loops. Our approach delivers hand-written–like code, but automatically. It explicitly avoids the reliance on black-box optimizers and sufficiently-smart compilers, offering highest, guaranteed and portable performance. Our approach relies on high-level concepts that are then readily mapped into an implementation. Accordingly, we have two distinct implementations: an OCaml stream library, staged via MetaOCaml, and a Scala library for the JVM, staged via LMS. In both cases, we derive libraries richer and simultaneously many tens of times faster than past work. We greatly exceed in performance the standard stream libraries available in Java, Scala and OCaml, including the well-optimized Java 8 streams.