@@ -143,7 +143,7 @@ import Data.Kind (Type)
144import Data.IORef
144import Data.IORef
145 (IORef, modifyIORef, newIORef, readIORef, writeIORef, atomicModifyIORef)
145 (IORef, modifyIORef, newIORef, readIORef, writeIORef, atomicModifyIORef)
146−import Data.Maybe (fromJust)
146+import Data.Maybe (fromJust, fromMaybe)
147#if __GLASGOW_HASKELL__ < 808
147#if __GLASGOW_HASKELL__ < 808
148import Data.Semigroup ((<>))
148import Data.Semigroup ((<>))
@@ -704,7 +704,7 @@ collectWorkerPendingLatency cur col = do
704 assert (latCount == 0 || latTime /= 0) (return ())
704 assert (latCount == 0 || latTime /= 0) (return ())
705 let latPair =
705 let latPair =
706 if latCount > 0 && latTime > 0
706 if latCount > 0 && latTime > 0
707− then Just $ (latCount, latTime)
707+ then Just (latCount, latTime)
708 else Nothing
708 else Nothing
709 return (totalCount, latPair)
709 return (totalCount, latPair)
@@ -748,7 +748,7 @@ collectLatency sv yinfo drain = do
748 case newLatPair of
748 case newLatPair of
749 Nothing -> retWith prevLat
749 Nothing -> retWith prevLat
750 Just (count, time) -> do
750 Just (count, time) -> do
751− let newLat = time `div` (fromIntegral count)
751+ let newLat = time `div` fromIntegral count
752 when (svarInspectMode sv) $ recordMinMaxLatency sv newLat
752 when (svarInspectMode sv) $ recordMinMaxLatency sv newLat
753 -- When we have collected a significant sized batch we compute the
753 -- When we have collected a significant sized batch we compute the
754 -- new latency using that batch and return the new latency,
754 -- new latency using that batch and return the new latency,
@@ -1102,7 +1102,7 @@ sendWithDoorBell q bell msg = do
1102-- | This function is used by the producer threads to queue output for the
1102-- | This function is used by the producer threads to queue output for the
1103-- consumer thread to consume. Returns whether the queue has more space.
1103-- consumer thread to consume. Returns whether the queue has more space.
1104send :: SVar t m a -> ChildEvent a -> IO Int
1104send :: SVar t m a -> ChildEvent a -> IO Int
1105−send sv msg = sendWithDoorBell (outputQueue sv) (outputDoorBell sv) msg
1105+send sv = sendWithDoorBell (outputQueue sv) (outputDoorBell sv)
1107-- There is no bound implemented on the buffer, this is assumed to be low
1107-- There is no bound implemented on the buffer, this is assumed to be low
1108-- traffic.
1108-- traffic.
@@ -1856,10 +1856,7 @@ dispatchWorkerPaced sv = do
1856 let elapsed = fromRelTime64 $ diffAbsTime64 now baseTime
1856 let elapsed = fromRelTime64 $ diffAbsTime64 now baseTime
1857 let latency =
1857 let latency =
1858 if lat == 0
1858 if lat == 0
1860− case workerBootstrapLatency yinfo of
1859+ then fromMaybe lat (workerBootstrapLatency yinfo)
1863 else lat
1860 else lat
1865 return (yieldCount, elapsed, latency)
1862 return (yieldCount, elapsed, latency)
@@ -2349,7 +2346,7 @@ getParallelSVar ss st mrun = do
2349 let bufLim =
2346 let bufLim =
2350 case getMaxBuffer st of
2347 case getMaxBuffer st of
2351 Unlimited -> undefined
2348 Unlimited -> undefined
2352− Limited x -> (fromIntegral x)
2349+ Limited x -> fromIntegral x
2353 remBuf <- newIORef bufLim
2350 remBuf <- newIORef bufLim
2354 pbMVar <- newMVar ()
2351 pbMVar <- newMVar ()