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/Optimize.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/GF/Compile/Optimize.hs') 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 +++ ":") -- cgit v1.2.3