Changeset 15777 for src/Pugs/Compile

Show
Ignore:
Timestamp:
03/22/07 20:58:32 (20 months ago)
Author:
audreyt
Message:

* Gain another ~10% on startup speed (Prelude+Test) by simply

changing all "atomically . newTVar" to "newTVarIO" when
atomicity is irrelevant.

Location:
src/Pugs/Compile
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile/PIL2.hs

    r15616 r15777  
    433433initTEnv :: Eval TEnv 
    434434initTEnv = do 
    435     initReg <- stm $ newTVar (0, "") 
    436     initLbl <- stm $ newTVar 0 
     435    initReg <- io $ newTVarIO (0, "") 
     436    initLbl <- io $ newTVarIO 0 
    437437    return $ MkTEnv 
    438438        { tLexDepth = 0 
  • src/Pugs/Compile/Pugs.hs

    r15745 r15777  
    130130        if Str.null vrefC then return Str.empty else do 
    131131        tv      <- io $ fmap (Str.pack . ('t':) . show . hashUnique) newUnique 
    132         tell [Str.concat [tv, Str.pack " <- stm (newTVar ", vrefC, Str.pack ");\n"]] 
     132        tell [Str.concat [tv, Str.pack " <- io (newTVarIO ", vrefC, Str.pack ");\n"]] 
    133133        return tv 
    134134