mirror of
https://github.com/composewell/streamly.git
synced 2024-08-17 15:30:24 +03:00
Fix workerPollingInterval
This commit is contained in:
parent
5e14c82cbe
commit
d6ccf9598c
@ -70,7 +70,11 @@ minThreadDelay = 1000000
|
||||
updateWorkerPollingInterval :: YieldRateInfo -> NanoSecond64 -> IO ()
|
||||
updateWorkerPollingInterval yinfo latency = do
|
||||
let periodRef = workerPollingInterval yinfo
|
||||
cnt = max 1 $ minThreadDelay `div` latency
|
||||
-- This depends on the rate, if the rate is low, latencies are
|
||||
-- small, by the time we poll it might be too late and we may have
|
||||
-- yielded too many results.
|
||||
-- cnt = max 1 $ minThreadDelay `div` latency
|
||||
cnt = max 1 (latency `div` svarLatencyTarget yinfo)
|
||||
period = min cnt (fromIntegral magicMaxBuffer)
|
||||
|
||||
writeIORef periodRef (fromIntegral period)
|
||||
|
Loading…
Reference in New Issue
Block a user