[GHC] #13246: hPutBuf issues unnecessary empty write syscalls for large writes

GHC ghc-devs at haskell.org
Fri Feb 10 00:54:13 UTC 2017


#13246: hPutBuf issues unnecessary empty write syscalls for large writes
-------------------------------------+-------------------------------------
        Reporter:  nh2               |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Runtime System    |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13245            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nh2):

 When writing the fix, I noticed that my description of what exactly is the
 bug is wrong.

 The `if (size - w > count)` isn't the problem, that's just another
 infelicity (e.g. it'll make that if you have an 8 K buffer and write 2 K
 chunks to it, we'll always flush 6 K buffers), which I'll fix too.

 The real bug is simply that we `flushWriteBuffer` even if `w == 0` (handle
 buffer is empty).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13246#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list