-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
performance improvements and addition of render-load monitoring with …
…display in client
- Loading branch information
Showing
10 changed files
with
143 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,59 @@ | ||
module Estuary.RenderState where | ||
|
||
import Data.Time.Clock | ||
import Data.Map | ||
import Data.IntMap.Strict | ||
import qualified Sound.Tidal.Context as Tidal | ||
|
||
import Estuary.Types.Definition | ||
|
||
data RenderInfo = RenderInfo { | ||
errors :: !(IntMap String), | ||
avgRenderLoad :: !Int, | ||
peakRenderLoad :: !Int, | ||
avgParseLoad :: !Int, | ||
peakParseLoad :: !Int, | ||
avgPatternsLoad :: !Int, | ||
peakPatternsLoad :: !Int | ||
} deriving (Show) | ||
|
||
emptyRenderInfo :: RenderInfo | ||
emptyRenderInfo = RenderInfo { | ||
errors = empty, | ||
avgRenderLoad = 0, | ||
peakRenderLoad = 0, | ||
avgParseLoad = 0, | ||
peakParseLoad = 0, | ||
avgPatternsLoad = 0, | ||
peakPatternsLoad = 0 | ||
} | ||
|
||
data RenderState = RenderState { | ||
logicalTime :: UTCTime, | ||
cachedDefs :: DefinitionMap, | ||
paramPatterns :: Map Int Tidal.ParamPattern, | ||
errors :: Map Int String, | ||
dirtEvents :: [(UTCTime,Tidal.ParamMap)], | ||
renderStartTime :: UTCTime, | ||
parseEndTime :: UTCTime, | ||
patternsToEventsEndTime :: UTCTime, | ||
renderEndTime :: UTCTime, | ||
renderTimes :: [NominalDiffTime], | ||
avgRenderTime :: NominalDiffTime | ||
logicalTime :: !UTCTime, | ||
cachedDefs :: !DefinitionMap, | ||
paramPatterns :: !(IntMap Tidal.ParamPattern), | ||
dirtEvents :: ![(UTCTime,Tidal.ParamMap)], | ||
renderStartTime :: !UTCTime, | ||
parseEndTime :: !UTCTime, | ||
patternsEndTime :: !UTCTime, | ||
renderEndTime :: !UTCTime, | ||
renderTimes :: ![NominalDiffTime], | ||
parseTimes :: ![NominalDiffTime], | ||
patternsTimes :: ![NominalDiffTime], | ||
info :: !RenderInfo | ||
} | ||
|
||
initialRenderState :: UTCTime -> RenderState | ||
initialRenderState t = RenderState { | ||
logicalTime = t, | ||
cachedDefs = empty, | ||
paramPatterns = empty, | ||
errors = empty, | ||
dirtEvents = [], | ||
renderStartTime = t, | ||
parseEndTime = t, | ||
patternsToEventsEndTime = t, | ||
patternsEndTime = t, | ||
renderEndTime = t, | ||
renderTimes = [], | ||
avgRenderTime = 0 | ||
parseTimes = [], | ||
patternsTimes = [], | ||
info = emptyRenderInfo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.