performance and code size improvements

- Use default case for constructors with no explicit match.
- self-compile is 15s now
- code size is 60% smaller

code size and self compile time on par with the idris-built version
This commit is contained in:
2025-01-18 21:33:49 -08:00
parent f991ca0d52
commit e3ae301c9c
11 changed files with 371 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ import Lib.Types
import Lib.Syntax
import Lib.Syntax
import Node
import Serialize
primNS : List String
primNS = ("Prim" :: Nil)
@@ -132,7 +133,11 @@ processModule importFC base stk qn@(QN ns nm) = do
-- update modules with result, leave the rest of context in case this is top file
top <- get
mc <- readIORef top.metaCtx
let modules = updateMap modns (MkModCtx top.defs mc top.ops) top.modules
let mod = MkModCtx top.defs mc top.ops
dumpModule qn src mod
let modules = updateMap modns mod top.modules
freshMC <- newIORef (MC EmptyMap 0 CheckAll)
modify (\ top => MkTop modules top.imported top.ns top.defs top.metaCtx top.verbose top.errors top.ops)