From fe1f6b03e7f151fcd27170046e2116fd7f400d4d Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 9 Aug 2005 13:21:13 +0000 Subject: [PATCH] [project @ 2005-08-09 13:21:13 by simonmar] mapUFM was strict in the structure of the tree, perhaps accidentally. In any case, this interacted badly with the use of mapVarEnv in SimplEnv.mkCoreSubst, which assumed that the map was lazy. mapUFM is now lazy in the structure of the tree, which matches the behaviour of FiniteMap.mapFM. This fixes some long compilation times, in particular HTMLMonad98.hs from WASH used to take 2 mins to compile without optimisation, now takes less than 20 seconds. --- ghc/compiler/utils/UniqFM.lhs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/utils/UniqFM.lhs b/ghc/compiler/utils/UniqFM.lhs index d2676bf..225dc33 100644 --- a/ghc/compiler/utils/UniqFM.lhs +++ b/ghc/compiler/utils/UniqFM.lhs @@ -717,10 +717,10 @@ insert_ele f n@(NodeUFM j p t1 t2) i a \begin{code} map_tree f (NodeUFM j p t1 t2) - = mkSSNodeUFM (NodeUFMData j p) (map_tree f t1) (map_tree f t2) + = mkLLNodeUFM (NodeUFMData j p) (map_tree f t1) (map_tree f t2) + -- NB. lazy! we know the tree is well-formed. map_tree f (LeafUFM i obj) = mkLeafUFM i (f obj) - map_tree f _ = panic "map_tree failed" \end{code} -- 1.7.10.4