As programmers we build increasingly complex software by creating abstractions and composing them. While this method is good for programmer productivity it comes at a performance cost and usually results in slower programs.
In functional programming, and Haskell in particular, there is a popular idiom to compose abstractions using an intermediate data structure: a producer function generates some piece of data which handed over to a consumer function. This form of composition suffers from having to allocate the intermediate data.
To deal with the cost of composition, the Haskell community has adapted an optimization, called fusion, which can eliminate intermediate data structures and fuse together a producer and a consumer into one function. The net result can often be as good as hand-tuned code. This talk will cover various forms of fusion and how they enable programmers to create and use guilt-free abstractions which don't come with a performance cost. It's like having your cake and eating it too.
In functional programming, and Haskell in particular, there is a popular idiom to compose abstractions using an intermediate data structure: a producer function generates some piece of data which handed over to a consumer function. This form of composition suffers from having to allocate the intermediate data.
To deal with the cost of composition, the Haskell community has adapted an optimization, called fusion, which can eliminate intermediate data structures and fuse together a producer and a consumer into one function. The net result can often be as good as hand-tuned code. This talk will cover various forms of fusion and how they enable programmers to create and use guilt-free abstractions which don't come with a performance cost. It's like having your cake and eating it too.
Have Your Cookie and Eat it Too – Josef Svenningsson | |
10 Likes | 10 Dislikes |
589 views views | 1,162 followers |
Science & Technology | Upload TimePublished on 5 Sep 2017 |
Không có nhận xét nào:
Đăng nhận xét