Cost of Overloading vs. HOFs

Conal Elliott 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:
>
> Hello,
>
> 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).
>
> Regards
> --
> Adrian Hey
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20070504/9fdc71c6/attachment.htm


More information about the Glasgow-haskell-users mailing list