jaspervdj/websockets — comment on commit 9ad6d831fd777e727c1ead14f191497ab3281632
File: src/Network/WebSockets/Monad.hs line 224
By yihuang:

Because `Blaze.ByteString.Enumerator.builderToByteString` don't send data out immediately, it fills a buffer with input data, it only send the buffer out when the buffer is big enough. and your implementation will cause too many write system calls issued, you should use flush (http://hackage.haskell.org/packages/archive/blaze-builder/0.3.1.0/doc/html/Blaze-ByteString-Builder.html#v:flush) .