summaryrefslogtreecommitdiff
path: root/src/GF/Compile/Coding.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/Coding.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/Coding.hs')
-rw-r--r--src/GF/Compile/Coding.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/GF/Compile/Coding.hs b/src/GF/Compile/Coding.hs
index 89e458956..665b5916d 100644
--- a/src/GF/Compile/Coding.hs
+++ b/src/GF/Compile/Coding.hs
@@ -26,13 +26,12 @@ codeSourceModule co (id,moi) = case moi of
ModMod mo -> (id, ModMod $ replaceJudgements mo (mapTree codj (jments mo)))
_ -> (id,moi)
where
- codj (c,info) = (c, case info of
+ codj (c,info) = case info of
ResOper pty pt -> ResOper (mapP codt pty) (mapP codt pt)
ResOverload es tyts -> ResOverload es [(codt ty,codt t) | (ty,t) <- tyts]
CncCat pty pt mpr -> CncCat pty (mapP codt pt) (mapP codt mpr)
CncFun mty pt mpr -> CncFun mty (mapP codt pt) (mapP codt mpr)
_ -> info
- )
codt t = case t of
K s -> K (co s)
T ty cs -> T ty [(codp p,codt v) | (p,v) <- cs]