forked from GitHub/gf-core
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.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user