
#13025: Type family reduction irregularity (change from 7.10.3 to 8.0.1)
-------------------------------------+-------------------------------------
Reporter: acowley | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Keywords: TypeFamilies | Operating System: Unknown/Multiple
Architecture: | Type of failure: Runtime
Unknown/Multiple | performance bug
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
I was recently made aware that [http://hackage.haskell.org/package/vinyl
vinyl]'s performance dramatically deteriorated with GHC 8.0.1 when
compared to GHC 7.x. Vinyl is an extensible records library that's been
around for about four years; the aspect of its design relevant here is the
basic HList-style indexed GADT. Care was taken in the past so that working
with, say, a `Storable` `Vector` of records would suffer no overhead from
`vinyl` when compared with standard records, and we have a benchmark suite
to spot check this.
In the move to GHC-8.0.1, it turns out that we do introduce overhead.
Inspecting the Core reveals that the benchmark inner loop includes a
`case` match on an `HEq_sc` value whose presence I would not expect, and
that is not present when compiling with GHC-7.10.3:
{{{
case HEq_sc
@ Nat
@ Nat
@ ('S 'Z)
@ (RIndex
'("normal", V3 Float)
'['("tex", V2 Float), '("normal", V3 Float)])
($s$fRElemar:S_$s$fRElemar:S_$cp1RElem
`cast` (N:~[0] <Nat>_N <'S 'Z>_N