Ticket #2902 (closed bug: fixed)
Example where ghc 6.10.1 fails to optimize recursive instance function calls
| Reported by: | Syzygies | Owned by: | igloo |
|---|---|---|---|
| Priority: | low | Milestone: | 7.2.1 |
| Component: | Compiler | Version: | 6.10.1 |
| Keywords: | class instance | Cc: | batterseapower@…, michal.terepeta@… |
| Operating System: | MacOS X | Architecture: | x86_64 (amd64) |
| Type of failure: | Runtime performance bug | Difficulty: | Unknown |
| Test Case: | T2902 | Blocked By: | |
| Blocking: | Related Tickets: |
Description
Using ghc 6.10.1, I get over a 3x performance boost on the attached toy example, by moving instance function definitions out of the instance declaration, so that recursive calls avoid the class dictionary.
According to SPJ, ghc 6.10.1 is supposed to perform this optimization automatically. I am reporting it as a bug at his request, following a discussion on the glasgow-haskell-users@… list.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

