diff options
| author | hallgren <hallgren@chalmers.se> | 2012-06-26 17:01:15 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-06-26 17:01:15 +0000 |
| commit | 241bef8a51ba18f5092d05065f3ecde60c01660f (patch) | |
| tree | 4934e112b8bf4856374a526ca695d00e3c6ecaba /src/compiler/GF/Compile/CheckGrammar.hs | |
| parent | 82a5c574b6b553fb23bd47bba0fbb511a7b7d6d3 (diff) | |
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.)
Diffstat (limited to 'src/compiler/GF/Compile/CheckGrammar.hs')
| -rw-r--r-- | src/compiler/GF/Compile/CheckGrammar.hs | 8 |
1 files changed, 3 insertions, 5 deletions
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 |
