I found that a server consumes around 100% of CPU load during bi-directional RPC.
I can repro the phenomenon even in a very simple call like the followings. On the other hand, libraries in other languages (e.g. grpc-go) don't that. So I'm afraid it is from an immanent problem in Mu-Haskell implementation. How can I tame it?
import Data.Conduit
import qualified Data.Conduit.Combinators as C
sayManyHellos
:: (MonadServer m)
=> ConduitT () HelloRequest m () -> ConduitT HelloResponse Void m () -> m ()
sayManyHellos src sink = do
let reply (HelloRequest n) = HelloResponse ("Hello, " <> n)
runConduit $ src .| C.map reply .| sink
I found that a server consumes around 100% of CPU load during bi-directional RPC.
I can repro the phenomenon even in a very simple call like the followings. On the other hand, libraries in other languages (e.g. grpc-go) don't that. So I'm afraid it is from an immanent problem in Mu-Haskell implementation. How can I tame it?