From 241bef8a51ba18f5092d05065f3ecde60c01660f Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 26 Jun 2012 17:01:15 +0000 Subject: Experiment with parallel grammar checks Introduced the function parallelCheck :: [Check a] -> Check [a] that runs independent checks in parallel, potentially allowing faster grammar compilation on multi-core computers, if you run gf with +RTS -N. However, on my dual core laptop, this seems to slow down compilation somewhat even though CPU utilization goes up as high as 170% at times. (This is with GF compiled with GHC 7.0.4.) --- src/compiler/GF/Compile/CheckGrammar.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/compiler/GF/Compile') diff --git a/src/compiler/GF/Compile/CheckGrammar.hs b/src/compiler/GF/Compile/CheckGrammar.hs index f7af80327..5988a20c8 100644 --- a/src/compiler/GF/Compile/CheckGrammar.hs +++ b/src/compiler/GF/Compile/CheckGrammar.hs @@ -56,11 +56,9 @@ checkModule opts mos mo@(m,mi) = do infoss <- checkErr $ topoSortJments2 mo foldM updateCheckInfos mo infoss where - updateCheckInfos mo0 = commitCheck . foldM updateCheckInfo mo0 - - updateCheckInfo mo@(m,mi) (i,info) = do - info <- accumulateError (checkInfo opts mos mo i) info - return (m,mi{jments=updateTree (i,info) (jments mi)}) + updateCheckInfos mo = fmap (foldl update mo) . parallelCheck . map check + where check (i,info) = fmap ((,) i) (checkInfo opts mos mo i info) + update mo@(m,mi) (i,info) = (m,mi{jments=updateTree (i,info) (jments mi)}) -- check if restricted inheritance modules are still coherent -- i.e. that the defs of remaining names don't depend on omitted names -- cgit v1.2.3