Skip to content

Commit

Permalink
Add performance test for #13056
Browse files Browse the repository at this point in the history
This performance regression was fixed by commit
517d03e (#12234). Let's add a performance test
to ensure that it doesn't break again.
  • Loading branch information
RyanGlScott committed Jan 6, 2017
1 parent b4f2afe commit 5088110
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
26 changes: 26 additions & 0 deletions testsuite/tests/perf/compiler/T13056.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}

module Bug where
import Data.Typeable
import GHC.Generics
import Data.Data

data Condition v = Condition
deriving (Functor, Foldable)

data CondTree v c a = CondNode
{ condTreeData :: a
, condTreeConstraints :: c
, condTreeComponents :: [CondBranch v c a]
}
deriving (Functor, Foldable)

data CondBranch v c a = CondBranch
{ condBranchCondition :: Condition v
, condBranchIfTrue :: CondTree v c a
, condBranchIfFalse :: Maybe (CondTree v c a)
}
deriving (Functor, Foldable)
11 changes: 10 additions & 1 deletion testsuite/tests/perf/compiler/all.T
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,6 @@ test('T12234',
compile,
[''])


test('T13035',
[ only_ways(['normal']),
compiler_stats_num_field('bytes allocated',
Expand All @@ -912,3 +911,13 @@ test('T13035',
],
compile,
[''] )

test('T13056',
[ only_ways(['optasm']),
compiler_stats_num_field('bytes allocated',
[(wordsize(64), 520166912, 5),
# 2017-01-06 520166912 initial
]),
],
compile,
['-O1'])

0 comments on commit 5088110

Please sign in to comment.