Commit before trying IntMap instead of vector for incidence graph
This commit is contained in:
@@ -1,42 +1,42 @@
|
|||||||
X_RANGE 11.44
|
X_RANGE 23.19
|
||||||
Y_RANGE 23375816.00
|
Y_RANGE 14888520.00
|
||||||
ORDER OTHER 1
|
ORDER OTHER 1
|
||||||
ORDER (144633)ix/updateEdge/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/updateDoors/functionalUpdate/ti... 2
|
ORDER (143425)#..\/#./rememberSounds/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates/c... 2
|
||||||
ORDER (145601)#..\/#./mcApplyDamage/updateMachine/dimap/dimap/_Wrapped'/updateIMl'/functionalUpdate/timeFlowUp... 3
|
ORDER (143174)updatePastWorlds/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSp... 3
|
||||||
ORDER (143309)ix/#..\/#./updateExpBarrel/updateBarreloid.\/updateBarreloid/updateCreature'/updateCreature/dima... 4
|
ORDER (143513)ix/#..\/#./updateExpBarrel/updateBarreloid.\/updateBarreloid/updateCreature'/updateCreature/dima... 4
|
||||||
ORDER (143235)ix/#..\/#./performActions/updateCreature'.\/updateCreature'/updateCreature/dimap/dimap/_Wrapped'... 5
|
ORDER (146310)#..\/#./mcApplyDamage/updateMachine/dimap/dimap/_Wrapped'/updateIMl'/functionalUpdate/timeFlowUp... 5
|
||||||
ORDER (143228)#..\/#./targetYouWhenCognizant/chaseCritInternal/ix/updateCreature'.\/updateCreature'/updateCrea... 6
|
ORDER (143439)ix/#..\/#./performActions/updateCreature'.\/updateCreature'/updateCreature/dimap/dimap/_Wrapped'... 6
|
||||||
ORDER (142970)updatePastWorlds/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSp... 7
|
ORDER (143432)#..\/#./targetYouWhenCognizant/chaseCritInternal/ix/updateCreature'.\/updateCreature'/updateCrea... 7
|
||||||
ORDER (144491)ix.\/ix/#..\/#./moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functiona... 8
|
ORDER (144727)ix.\/ix/#..\/#./moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functiona... 8
|
||||||
ORDER (138431)zoneIncPe.f/zoneIncPe/#..\/#./generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/... 9
|
ORDER (149438)#..\/#./untaintedDot/each/_1/doDoorMount.\/doDoorMount/doorLerp.domounts/doorLerp/updateDoor/upd... 9
|
||||||
ORDER (144689)ix/crCrSpring/crSpring/simpleCrSprings/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateU... 10
|
ORDER (138578)zoneIncPe.f/zoneIncPe/#..\/#./generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/... 10
|
||||||
ORDER (144506)moveWall.newwl/moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functional... 11
|
ORDER (144742)moveWall.newwl/moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functional... 11
|
||||||
ORDER (143210)chaseCritAwarenessUpdate/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates... 12
|
ORDER (145015)ix/crCrSpring/crSpring/simpleCrSprings/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateU... 12
|
||||||
ORDER (144622)ix/getNodePos/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/updateDoors/functionalUpdate/ti... 13
|
ORDER (143414)chaseCritAwarenessUpdate/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates... 13
|
||||||
ORDER (144511)each/#..\/#./taintedDot/each/doorLerp.wlposs/doorLerp.f/doorLerp/updateDoor/updateDoors/function... 14
|
ORDER (144747)each/#..\/#./taintedDot/each/doorLerp.wlposs/doorLerp.f/doorLerp/updateDoor/updateDoors/function... 14
|
||||||
ORDER (144740)colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/t... 15
|
ORDER (145066)colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/t... 15
|
||||||
ORDER (143289)ix/checkDeath'.tocr/#..\/#./checkDeath'/checkDeath/crUpdate/updateCreature'.\/updateCreature'/up... 16
|
ORDER (144970)primitive/basicUnsafeCopy/ix.\/ix/updateEdge/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/... 16
|
||||||
ORDER (144620)updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/updateDoors/functionalUpdate/timeFlowUpdate/u... 17
|
ORDER (143493)ix/checkDeath'.tocr/#..\/#./checkDeath'/checkDeath/crUpdate/updateCreature'.\/updateCreature'/up... 17
|
||||||
ORDER (142987)#..\/#./zoneCreatures/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRen... 18
|
ORDER (144815)each/_1/doDoorMount.\/doDoorMount/doorLerp.domounts/doorLerp/updateDoor/updateDoors/functionalUp... 18
|
||||||
ORDER (156022)listSelectionColorPicture.g/listSelectionColorPicture/updateSection.(...)/updateSection/updateSe... 19
|
ORDER (143191)#..\/#./zoneCreatures/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRen... 19
|
||||||
ORDER (144644)primitive/basicUnsafeCopy/ix.\/ix/updateEdge/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/... 20
|
ORDER (149444)_xy/#..\/#./untaintedDot/each/_1/doDoorMount.\/doDoorMount/doorLerp.domounts/doorLerp/updateDoor... 20
|
||||||
SHADE OTHER 0.00
|
SHADE OTHER 0.00
|
||||||
SHADE (144633)ix/updateEdge/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/updateDoors/functionalUpdate/ti... 0.00
|
SHADE (143425)#..\/#./rememberSounds/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates/c... 0.00
|
||||||
SHADE (145601)#..\/#./mcApplyDamage/updateMachine/dimap/dimap/_Wrapped'/updateIMl'/functionalUpdate/timeFlowUp... 0.00
|
SHADE (143174)updatePastWorlds/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSp... 0.00
|
||||||
SHADE (143309)ix/#..\/#./updateExpBarrel/updateBarreloid.\/updateBarreloid/updateCreature'/updateCreature/dima... 0.00
|
SHADE (143513)ix/#..\/#./updateExpBarrel/updateBarreloid.\/updateBarreloid/updateCreature'/updateCreature/dima... 0.00
|
||||||
SHADE (143235)ix/#..\/#./performActions/updateCreature'.\/updateCreature'/updateCreature/dimap/dimap/_Wrapped'... 0.10
|
SHADE (146310)#..\/#./mcApplyDamage/updateMachine/dimap/dimap/_Wrapped'/updateIMl'/functionalUpdate/timeFlowUp... 0.10
|
||||||
SHADE (143228)#..\/#./targetYouWhenCognizant/chaseCritInternal/ix/updateCreature'.\/updateCreature'/updateCrea... 0.10
|
SHADE (143439)ix/#..\/#./performActions/updateCreature'.\/updateCreature'/updateCreature/dimap/dimap/_Wrapped'... 0.10
|
||||||
SHADE (142970)updatePastWorlds/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSp... 0.10
|
SHADE (143432)#..\/#./targetYouWhenCognizant/chaseCritInternal/ix/updateCreature'.\/updateCreature'/updateCrea... 0.10
|
||||||
SHADE (144491)ix.\/ix/#..\/#./moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functiona... 0.10
|
SHADE (144727)ix.\/ix/#..\/#./moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functiona... 0.10
|
||||||
SHADE (138431)zoneIncPe.f/zoneIncPe/#..\/#./generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/... 0.00
|
SHADE (149438)#..\/#./untaintedDot/each/_1/doDoorMount.\/doDoorMount/doorLerp.domounts/doorLerp/updateDoor/upd... 0.00
|
||||||
SHADE (144689)ix/crCrSpring/crSpring/simpleCrSprings/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateU... 0.00
|
SHADE (138578)zoneIncPe.f/zoneIncPe/#..\/#./generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/... 0.00
|
||||||
SHADE (144506)moveWall.newwl/moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functional... 0.00
|
SHADE (144742)moveWall.newwl/moveWall/moveWallID/ifoldl'/doorLerp.f/doorLerp/updateDoor/updateDoors/functional... 0.00
|
||||||
SHADE (143210)chaseCritAwarenessUpdate/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates... 0.00
|
SHADE (145015)ix/crCrSpring/crSpring/simpleCrSprings/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateU... 0.00
|
||||||
SHADE (144622)ix/getNodePos/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/updateDoors/functionalUpdate/ti... 0.05
|
SHADE (143414)chaseCritAwarenessUpdate/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates... 0.05
|
||||||
SHADE (144511)each/#..\/#./taintedDot/each/doorLerp.wlposs/doorLerp.f/doorLerp/updateDoor/updateDoors/function... 0.05
|
SHADE (144747)each/#..\/#./taintedDot/each/doorLerp.wlposs/doorLerp.f/doorLerp/updateDoor/updateDoors/function... 0.05
|
||||||
SHADE (144740)colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/t... 0.05
|
SHADE (145066)colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/t... 0.05
|
||||||
SHADE (143289)ix/checkDeath'.tocr/#..\/#./checkDeath'/checkDeath/crUpdate/updateCreature'.\/updateCreature'/up... 0.05
|
SHADE (144970)primitive/basicUnsafeCopy/ix.\/ix/updateEdge/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/... 0.05
|
||||||
SHADE (144620)updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/updateDoors/functionalUpdate/timeFlowUpdate/u... 0.10
|
SHADE (143493)ix/checkDeath'.tocr/#..\/#./checkDeath'/checkDeath/crUpdate/updateCreature'.\/updateCreature'/up... 0.10
|
||||||
SHADE (142987)#..\/#./zoneCreatures/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRen... 0.10
|
SHADE (144815)each/_1/doDoorMount.\/doDoorMount/doorLerp.domounts/doorLerp/updateDoor/updateDoors/functionalUp... 0.10
|
||||||
SHADE (156022)listSelectionColorPicture.g/listSelectionColorPicture/updateSection.(...)/updateSection/updateSe... 0.10
|
SHADE (143191)#..\/#./zoneCreatures/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRen... 0.10
|
||||||
SHADE (144644)primitive/basicUnsafeCopy/ix.\/ix/updateEdge/updateEdgeWallObs/updateEdgesWall'/updateEdgesWall/... 0.10
|
SHADE (149444)_xy/#..\/#./untaintedDot/each/_1/doDoorMount.\/doDoorMount/doorLerp.domounts/doorLerp/updateDoor... 0.10
|
||||||
|
|||||||
@@ -210,7 +210,8 @@ collidePointWallsFilter t sp ep = collidePoint sp ep . filter t . wlsNearSeg sp
|
|||||||
|
|
||||||
overlapSegWalls :: Point2 -> Point2 -> [Wall] -> [(Point2, Wall)]
|
overlapSegWalls :: Point2 -> Point2 -> [Wall] -> [(Point2, Wall)]
|
||||||
{-# INLINE overlapSegWalls #-}
|
{-# INLINE overlapSegWalls #-}
|
||||||
overlapSegWalls sp ep = mapMaybe $ \wl -> uncurry (intersectSegSeg sp ep) (_wlLine wl) <&> (,wl)
|
overlapSegWalls sp ep = mapMaybe
|
||||||
|
$ \wl -> uncurry (intersectSegSeg sp ep) (_wlLine wl) <&> (,wl)
|
||||||
|
|
||||||
visibleWalls :: Point2 -> Point2 -> World -> [(Point2, Wall)]
|
visibleWalls :: Point2 -> Point2 -> World -> [(Point2, Wall)]
|
||||||
{-# INLINE visibleWalls #-}
|
{-# INLINE visibleWalls #-}
|
||||||
|
|||||||
+1
-7
@@ -55,16 +55,10 @@ getEdgesCrossing s e w = filter inedgecrosses $ nearSeg peZoneSize _incEdgeZonin
|
|||||||
updateEdge ::
|
updateEdge ::
|
||||||
(Set.Set EdgeObstacle -> Set.Set EdgeObstacle) ->
|
(Set.Set EdgeObstacle -> Set.Set EdgeObstacle) ->
|
||||||
(Int, Int) ->
|
(Int, Int) ->
|
||||||
-- V.Vector [(Int, SimpleEdge)] ->
|
|
||||||
-- V.Vector [(Int, SimpleEdge)]
|
|
||||||
V.Vector (IM.IntMap SimpleEdge) ->
|
V.Vector (IM.IntMap SimpleEdge) ->
|
||||||
V.Vector (IM.IntMap SimpleEdge)
|
V.Vector (IM.IntMap SimpleEdge)
|
||||||
|
{-# INLINE updateEdge #-}
|
||||||
updateEdge f (i, j) = ix i . ix j . seObstacles %~ f
|
updateEdge f (i, j) = ix i . ix j . seObstacles %~ f
|
||||||
--updateEdge f (i, j) = ix i . each %~ g
|
|
||||||
-- where
|
|
||||||
-- g (k, o)
|
|
||||||
-- | j == k = (k, o & seObstacles %~ f)
|
|
||||||
-- | otherwise = (k, o)
|
|
||||||
|
|
||||||
makePathUsing :: (Set.Set EdgeObstacle -> Bool) -> Point2 -> Point2 -> World -> Maybe [Int]
|
makePathUsing :: (Set.Set EdgeObstacle -> Bool) -> Point2 -> Point2 -> World -> Maybe [Int]
|
||||||
makePathUsing t s e w = do
|
makePathUsing t s e w = do
|
||||||
|
|||||||
@@ -141,9 +141,7 @@ wlsHit sp ep = sortOn (dist sp . fst) . wlsHitUnsorted sp ep
|
|||||||
wlsHitUnsorted :: Point2 -> Point2 -> World -> [(Point2, Wall)]
|
wlsHitUnsorted :: Point2 -> Point2 -> World -> [(Point2, Wall)]
|
||||||
wlsHitUnsorted sp ep
|
wlsHitUnsorted sp ep
|
||||||
| sp == ep = const mempty
|
| sp == ep = const mempty
|
||||||
| otherwise =
|
| otherwise = overlapSegWalls sp ep . wlsNearSeg sp ep
|
||||||
overlapSegWalls sp ep
|
|
||||||
. wlsNearSeg sp ep
|
|
||||||
|
|
||||||
wlsHitRadial :: Point2 -> Float -> World -> [(Point2, Wall)]
|
wlsHitRadial :: Point2 -> Float -> World -> [(Point2, Wall)]
|
||||||
wlsHitRadial p r = mapMaybe f . wlsNearCirc p r
|
wlsHitRadial p r = mapMaybe f . wlsNearCirc p r
|
||||||
|
|||||||
+2
-1
@@ -76,7 +76,8 @@ doLoop spf window worldSideEffects eventFn startWorld = do
|
|||||||
maybeUpdatedWorld <- pollEvents >>= foldM (applyEventIO eventFn) (Just worldAfterSimStep)
|
maybeUpdatedWorld <- pollEvents >>= foldM (applyEventIO eventFn) (Just worldAfterSimStep)
|
||||||
case maybeUpdatedWorld of
|
case maybeUpdatedWorld of
|
||||||
Just updatedWorld -> do
|
Just updatedWorld -> do
|
||||||
performGC
|
performGC -- potentially use performMinorGC
|
||||||
|
-- https://stackoverflow.com/questions/30244139/how-to-keep-very-big-elements-on-memory-without-exhausting-the-garbage-collector
|
||||||
endTicks <- ticks -- it might be better to use System.Clock (monotonic)
|
endTicks <- ticks -- it might be better to use System.Clock (monotonic)
|
||||||
let theDelay = max 0 (spf + fromIntegral startTicks - fromIntegral endTicks)
|
let theDelay = max 0 (spf + fromIntegral startTicks - fromIntegral endTicks)
|
||||||
threadDelay (theDelay * 1000)
|
threadDelay (theDelay * 1000)
|
||||||
|
|||||||
Reference in New Issue
Block a user