Skip to content
  • Petr Pudlak's avatar
    Add 'yield' statements in Haskell code · 7fa3fffe
    Petr Pudlak authored
    - After a message is sent over the network (even UDS), it takes a
      non-trivial amount of time for a client to parse the message, reply
      and encode a new one. Therefore reading immediately from the network
      just wastes system calls. It has been observed that 'yield'-ing at
      this point saves these system calls, yielding to overall better
      performance.
      See http://www.yesodweb.com/blog/2014/02/new-warp
    
    
    - Similarly, when an asynchronous writer finishes its job, it makes
      sense to give priority to other threads. This allows the other tasks
      to proceed, resulting in bigger batches of work for the asynchronous
      writer under higher loads.
    
    Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
    Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
    7fa3fffe