id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
4979,IO performance regression in 7.0.2,simonpj,simonmar,"If you benchmark `spectral/sphere` you'll see a 25% increase in allocation between 7.0.1 and 7.0.2.  I spent quite a while wondering what was going on, but I think I know now: the I/O library has changed.   In particular, in 7.0.2 `GHC.IO.Handle.Internals` has a function `writeCharBuffer` that doesn't exist in 7.0.1; and this function is indirectly responsible for the extra allocation.

In a bit more detail, 
 * The extra allocation actually happens in `GHC.IO.Encoding.Iconv.mkTextEncoding4`. 
 * This function is (indirectly) packaged into the first field of a `BufferCodec` structure.  
 * This structure is unpacked,  and the first field is called, in `GHC.IO.Handle.Internals.$wa2`.  
 * And that function in turn is the worker for `writeCharBuffer`.

Beyond this I cannot say.  Maybe this is a good change and the extra work is necessary.  Maybe not.  But that is where the regression comes from. It'd be good to check.
",bug,closed,normal,,Compiler,7.0.1,wontfix,,,Unknown/Multiple,Unknown/Multiple,None/Unknown,,,,,
