IO performance regression in 7.0.2
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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |