Hostname: page-component-586b7cd67f-dsjbd Total loading time: 0 Render date: 2024-11-25T08:09:00.624Z Has data issue: false hasContentIssue false

Faster coroutine pipelines: A reconstruction

Published online by Cambridge University Press:  03 August 2020

RUBEN P. PIETERS
Affiliation:
KU Leuven, Leuven, Belgium, (e-mails: [email protected], [email protected])
TOM SCHRIJVERS
Affiliation:
KU Leuven, Leuven, Belgium, (e-mails: [email protected], [email protected])
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

The three-continuation approach to coroutine pipelines efficiently represents a large number of connected components. Previous work in this area introduces this alternative encoding but does not shed much light on the underlying principles for deriving this encoding from its specification. This paper gives this missing insight by deriving the three-continuation encoding based on eliminating the mutual recursion in the definition of the connect operation. Using the same derivation steps, we are able to derive a similar encoding for a more general setting, namely bidirectional pipes. Additionally, we evaluate the encoding in an advertisement analytics benchmark where it is as performant as pipes, conduit, and streamly, which are other common Haskell stream processing libraries.

Type
Research Article
Copyright
© The Author(s), 2020. Published by Cambridge University Press

References

Blöndal, B., Löh, A. & Scott, R. (2018) Deriving via: or, how to turn hand-written instances into an anti-pattern. In Proceedings of the 11th ACM SIGPLAN International Symposium on Haskell, Haskell@ICFP 2018, St. Louis, MO, USA, September 27–17, 2018, pp. 5567.CrossRefGoogle Scholar
Breitner, J. (2018). A promise checked is a promise kept: Inspection testing. In Proceedings of the 11th ACM SIGPLAN International Symposium on Haskell. Haskell 2018. New York, NY, USA: ACM, pp. 1425.CrossRefGoogle Scholar
Chintapalli, S., Dagit, D., Evans, B., Farivar, R., Graves, T., Holderbaugh, M., Liu, Z., Nusbaum, K., Patil, K., Peng, B. J. & Poulosky, P. (2016) Benchmarking streaming computation engines: Storm, flink and spark streaming. In 2016 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), pp. 17891792.CrossRefGoogle Scholar
Church, A. (1941) The Calculi of Lambda-Conversion. Princeton, New York: Princeton University Press.Google Scholar
Claessen, K. (2004) Parallel parsing processes. J. Funct. Program. 14(6), 741757.CrossRefGoogle Scholar
Corrado, B. & Alessandro, B. (1985) Automatic synthesis of typed lambda-programs on term algebras. Theor. Comput. Sci. 39, 135154.Google Scholar
Coutts, D. (2011) Stream Fusion: Practical Shortcut Fusion for Coinductive Sequence Types. PhD Thesis, UK: University of Oxford.Google Scholar
Ghani, N., Hancock, P. & Pattinson, D. (2009) Representations of stream processors using nested fixed points. Log. Methods Comput. Sci. 5(3).CrossRefGoogle Scholar
Ghani, N., Uustalu, T. & Vene, V. (2004) Build, augment and destroy, universally. In Programming Languages and Systems, Chin, W.-N. (ed). Berlin, Heidelberg: Springer, pp. 327347.CrossRefGoogle Scholar
Gill, A. J., Launchbury, J. & Peyton Jones, S. L. (1993) A short cut to deforestation. In Proceedings of the Conference on Functional programming Languages and Computer Architecture, FPCA 1993, Copenhagen, Denmark, June 9–11, 1993, pp. 223232.CrossRefGoogle Scholar
Gonzalez, G. (2012) Haskell Pipes Library. http://hackage.haskell.org/package/pipes.Google Scholar
Hirzel, M., Soulé, R., Schneider, S., Gedik, B. & Grimm, R. (2013) A catalog of stream processing optimizations. ACM Comput. Surv. 46(4), 46:146:34.CrossRefGoogle Scholar
Kammar, O., Lindley, S. & Oury, N. (2013) Handlers in action. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming. ICFP’13. New York, NY, USA: ACM, pp. 145158.CrossRefGoogle Scholar
Kiselyov, O., Biboudis, A., Palladinos, N. & Smaragdakis, Y. (2017) Stream fusion, to completeness. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18–20, 2017, pp. 285299.CrossRefGoogle Scholar
Kumar, H. (2017) Haskell Streamly Library. http://hackage.haskell.org/package/streamly.Google Scholar
Lindley, S., McBride, C. & McLaughlin, C. (2017) Do be do be do. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages. POPL 2017. New York, NY, USA: ACM, pp. 500514.CrossRefGoogle Scholar
Mogensen, T. (1992) Efficient self-interpretation in lambda calculus. J. Funct. Program. 2(3), 345364.CrossRefGoogle Scholar
O’Sullivan, B. (2009) Haskell Criterion Library. http://hackage.haskell.org/package/criterion.Google Scholar
Peyton Jones, S. L., Tolmach, A. & Hoare, T. (2001) Playing by the rules: Rewriting as a practical optimisation technique in ghc. In 2001 Haskell Workshop.Google Scholar
Pieters, R. P. (2018a) Faster Coroutine Pipelines: A Reconstruction, Benchmarking Code. https://github.com/rubenpieters/orth-pipes-bench.Google Scholar
Pieters, R. P. (2018b) Faster Coroutine Pipelines: A Reconstruction, Library. https://github.com/rubenpieters/Orthogonal-Pipes.Google Scholar
Pieters, R. P. & Schrijvers, T. (2019) Faster coroutine pipelines: A reconstruction. In Practical Aspects of Declarative Languages, Alferes, J. J. & Johansson, M. (eds), Cham: Springer International Publishing, pp. 133149.Google Scholar
Plotkin, G. D. & Abadi, M. (1993) A logic for parametric polymorphism. In Proceedings of the International Conference on Typed Lambda Calculi and Applications. TLCA’93. London, UK, UK: Springer-Verlag, pp. 361375.CrossRefGoogle Scholar
Shivers, O. & Might, M. (2006) Continuations and transducer composition. In Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation. PLDI’06. New York, NY, USA: ACM, pp. 295307.CrossRefGoogle Scholar
Snoyman, M. (2011) Haskell Conduit Library. http://hackage.haskell.org/package/conduit.Google Scholar
Spivey, M. (2017) Faster coroutine pipelines. Proc. ACM Program. Lang. 1(ICFP), 5:15:23.CrossRefGoogle Scholar
Svenningsson, J. (2002) Shortcut fusion for accumulating parameters & zip-like functions. In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming (ICFP’02), Pittsburgh, Pennsylvania, USA, October 4–6, 2002, pp. 124132.Google Scholar
Voigtländer, J. (2008) Asymptotic improvement of computations over free monads. In Proceedings of the 9th International Conference on Mathematics of Program Construction. MPC’08. Berlin, Heidelberg: Springer-Verlag, pp. 388403.CrossRefGoogle Scholar
Supplementary material: File

Pieters and Schrijvers supplementary material

Pieters and Schrijvers supplementary material

Download Pieters and Schrijvers supplementary material(File)
File 7.5 KB
Submit a response

Discussions

No Discussions have been published for this article.