summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Optimize.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/Optimize.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/Optimize.hs')
-rw-r--r--src/GF/Compile/Optimize.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/GF/Compile/Optimize.hs b/src/GF/Compile/Optimize.hs
index 05a3826bf..da18e6e3e 100644
--- a/src/GF/Compile/Optimize.hs
+++ b/src/GF/Compile/Optimize.hs
@@ -107,7 +107,7 @@ evalResInfo oopts gr (c,info) = case info of
evalCncInfo ::
- Options -> SourceGrammar -> Ident -> Ident -> (Ident,Info) -> Err (Ident,Info)
+ Options -> SourceGrammar -> Ident -> Ident -> (Ident,Info) -> Err Info
evalCncInfo opts gr cnc abs (c,info) = do
seq (prtIf (verbAtLeast opts Verbose) c) $ return ()
@@ -126,7 +126,7 @@ evalCncInfo opts gr cnc abs (c,info) = do
ppr' <- liftM yes $ evalPrintname gr c ppr (yes $ K $ prt c)
- return (c, CncCat ptyp pde' ppr')
+ return (CncCat ptyp pde' ppr')
CncFun (mt@(Just (_,ty@(cont,val)))) pde ppr -> --trace (prt c) $
eIn ("linearization in type" +++ prt (mkProd (cont,val,[])) ++++ "of function") $ do
@@ -136,9 +136,9 @@ evalCncInfo opts gr cnc abs (c,info) = do
_ -> return pde
ppr' <- liftM yes $ evalPrintname gr c ppr pde'
- return $ (c, CncFun mt pde' ppr') -- only cat in type actually needed
+ return $ CncFun mt pde' ppr' -- only cat in type actually needed
- _ -> return (c,info)
+ _ -> return info
where
pEval = partEval opts gr
eIn cat = errIn ("Error optimizing" +++ cat +++ prt c +++ ":")