Cost of Overloading vs. HOFs
conal at conal.net
Fri May 4 18:07:41 EDT 2007
Does anyone know what became of Dictionary-free Overloading by Partial
Evaluation <http://web.cecs.pdx.edu/%7Empj/pubs/pepm94.html>? Is it
impractical for some reason?
On 5/4/07, Adrian Hey <ahey at iee.org> wrote:
> The GHC users guide says overloading "is death to performance if
> left to linger in an inner loop" and one thing I noticed while
> playing about with the AVL lib was that using a HOF and passing
> the (overloaded) compare function as an explicit argument at the
> start seemed to give noticable a performance boost (compared with
> dictionary passing presumably).
> I'm not sure why that should be, but has anyone else noticed this?
> If so, maybe this advice should be added to the user guide, especially
> if your function repeatedly uses just one method from a class?
> (or maybe not if it's nonsense :-)
> I guess having done this there would be little to gain by using the
> SPECIALIZE pragma though (unless ghc also specialises HOFs).
> Adrian Hey
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users