Sciweavers

PEPM
2010
ACM

Optimizing generics is easy!

14 years 1 months ago
Optimizing generics is easy!
Datatype-generic programming increases program reliability by reducing code duplication and enhancing reusability and modularity. Several generic programming libraries for Haskell have been developed in the past few years. These libraries have been compared in detail with respect to expressiveness, extensibility, typing issues, etc., but performance comparisons have been brief, limited, and preliminary. It is widely believed that generic programs run slower than hand-written code. In this paper we present an extensive benchmark suite for generic functions and analyze the potential for automatic code optimization at compilation time. Our benchmark confirms that generic programs, when compiled with the standard optimization flags of the Glasgow Haskell Compiler (GHC), are substantially slower than their hand-written counterparts. However, we also find that more advanced optimization capabilities of GHC can be used to further optimize generic functions, sometimes achieving the same ef...
José Pedro Magalhães, Stefan Holderm
Added 17 Mar 2010
Updated 17 Mar 2010
Type Conference
Year 2010
Where PEPM
Authors José Pedro Magalhães, Stefan Holdermans, Johan Jeuring, Andres Löh
Comments (0)