@gdmcbain

Call-pattern specialisation for Haskell programs

. Proceedings of the 12th ACM SIGPLAN international conference on Functional programming, page 327--337. New York, NY, USA, ACM, (2007)
DOI: 10.1145/1291151.1291200

Abstract

User-defined data types, pattern-matching, and recursion are ubiquitous features of Haskell programs. Sometimes a function is called with arguments that are statically known to be in constructor form, so that the work of pattern-matching is wasted. Even worse, the argument is sometimes freshly-allocated, only to be immediately decomposed by the function. In this paper we describe a simple, modular transformation that specialises recursive functions according to their argument "shapes". We describe our implementation of this transformation in the Glasgow Haskell Compiler, and give measurements that demonstrate substantial performance improvements: a worthwhile 10\% on average, with a factor of 10 in particular cases.

Links and resources

Tags

community