From 5dee98234e3df45d30f4aa6048bbd39c26d7af43 Mon Sep 17 00:00:00 2001 From: bjorn Date: Wed, 26 Nov 2008 15:44:22 +0000 Subject: My profiling showed that the BinTree operations were responsible for about 60% of the CPU time when reading a large .gfo file. Replacing BinTree by Data.Map reduced this to about 6%, which meant about 50% reduction in total CPU time. --- src/GF/Compile/GrammarToGFCC.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/GF/Compile/GrammarToGFCC.hs') diff --git a/src/GF/Compile/GrammarToGFCC.hs b/src/GF/Compile/GrammarToGFCC.hs index 13f6eb9d2..bb99d9d6c 100644 --- a/src/GF/Compile/GrammarToGFCC.hs +++ b/src/GF/Compile/GrammarToGFCC.hs @@ -283,9 +283,9 @@ canon2canon abs cg0 = j2j cg (f,j) = let debug = traceD ("+ " ++ prt f) in case j of - CncFun x (Yes tr) z -> (f,CncFun x (Yes (debug (t2t tr))) z) - CncCat (Yes ty) (Yes x) y -> (f,CncCat (Yes (ty2ty ty)) (Yes (t2t x)) y) - _ -> (f,j) + CncFun x (Yes tr) z -> CncFun x (Yes (debug (t2t tr))) z + CncCat (Yes ty) (Yes x) y -> CncCat (Yes (ty2ty ty)) (Yes (t2t x)) y + _ -> j where cg1 = cg t2t = term2term f cg1 pv @@ -295,8 +295,8 @@ canon2canon abs cg0 = -- flatten record arguments of param constructors p2p (f,j) = case j of ResParam (Yes (ps,v)) -> - (f,ResParam (Yes ([(c,concatMap unRec cont) | (c,cont) <- ps],Nothing))) - _ -> (f,j) + ResParam (Yes ([(c,concatMap unRec cont) | (c,cont) <- ps],Nothing)) + _ -> j unRec (x,ty) = case ty of RecType fs -> [ity | (_,typ) <- fs, ity <- unRec (identW,typ)] _ -> [(x,ty)] -- cgit v1.2.3