summaryrefslogtreecommitdiff
path: root/src/GF/Compile/GrammarToGFCC.hs
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-11-26 15:44:22 +0000
committerbjorn <bjorn@bringert.net>2008-11-26 15:44:22 +0000
commit5dee98234e3df45d30f4aa6048bbd39c26d7af43 (patch)
treef989834cb838cac440ecf9f3832e774e9468b6d1 /src/GF/Compile/GrammarToGFCC.hs
parent260e13146e48992ce2c4fc323b78c94a31cf8dcf (diff)
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.
Diffstat (limited to 'src/GF/Compile/GrammarToGFCC.hs')
-rw-r--r--src/GF/Compile/GrammarToGFCC.hs10
1 files changed, 5 insertions, 5 deletions
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)]