#5536: IO performance regression in 7.2 vs 7.0
---------------------------------+------------------------------------------
Reporter: simonmar | Owner: batterseapower
Type: bug | Status: new
Priority: high | Milestone: 7.4.1
Component: libraries/base | Version: 7.2.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by batterseapower):
It could definitely be to do with the change to writeBlocks/unpack: in
writeBlocks (invoked from putStr) we have to do an extra test on each
character to see if we have to map them to lone surrogatess in the
CharBuf. Likewise, in unpack (invoked from getContents) we have to test
each element of the CharBuf to see if it is a lone surrogate we should map
to our private-use area.
This is a consequence of the decision to use private-use characters for
encoding roundtrip characters, as opposed to using lone surrogates
directly (like Python does).
One possible avenue for improvement is that in this invocation of unpack
we know that the CharBuf can't contain any lone surrogates (since it came
from a binary-mode handle), so we could avoid the test. Actually
implementing this might be a bit tricky, though.
I did eyeball the unpack loop and noticed that
surrogatifyRoundtripCharacter was returning a boxed character. This is
pretty much a disaster, so I added INLINE pragmas to all of the small
combinators in Failure.hs, which moved the runtime of a binary "cat" from
2.2s to 2.0s on my machine (7.0.4 clocks in at 1.5s). Is this the change
Simon made in ea4bb083c6222e7c774fdb554f24f17a53ae350d? I can't actually
see that commit in my repo, for some reason.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5536#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs