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/Coding.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/GF/Compile/Coding.hs') 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] -- cgit v1.2.3