diff options
| author | bjorn <bjorn@bringert.net> | 2008-11-26 15:44:22 +0000 |
|---|---|---|
| committer | bjorn <bjorn@bringert.net> | 2008-11-26 15:44:22 +0000 |
| commit | 5dee98234e3df45d30f4aa6048bbd39c26d7af43 (patch) | |
| tree | f989834cb838cac440ecf9f3832e774e9468b6d1 /src/GF/Compile/Optimize.hs | |
| parent | 260e13146e48992ce2c4fc323b78c94a31cf8dcf (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.hs | 8 |
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 +++ ":") |
