Pretty: remove a harmful $! (#12227)
ClosedPublic

Authored by thomie on Jul 11 2016, 12:19 PM.

Details

Summary

This is backport of [1] for GHC's copy of Pretty. See Note [Differences
between libraries/pretty and compiler/utils/Pretty.hs].

[1] http://git.haskell.org/packages/pretty.git/commit/bbe9270c5f849a5bb74c9166a5f4202cfb0dba22

https://github.com/haskell/pretty/issues/32
https://github.com/haskell/pretty/pull/35

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
thomie retitled this revision from to Pretty: remove a harmful $! (#12227).Jul 11 2016, 12:19 PM
thomie updated this object.
thomie edited the test plan for this revision. (Show Details)
thomie updated the Trac tickets for this revision.
thomie updated this revision to Diff 8188.Jul 11 2016, 12:52 PM

Compile-time performance differences:

  • -67% 'bytes allocated' for T12227 (8.0.1 even looped on this one)
  • -3% 'max_bytes_used' for T3294
  • +3% 'bytes allocated' for T3294 (I don't know why, but I'm ignoring it)
thomie added inline comments.Jul 11 2016, 1:02 PM
compiler/utils/Pretty.hs
636

I didn't add any comments here, because I would like to keep the differences between this module and libraries/pretty as small as possible. The function beside is now exactly the same as it is in pretty (compare https://github.com/haskell/pretty/blob/master/src/Text/PrettyPrint/Annotated/HughesPJ.hs#L687-L702).

Any regressions will be caught by the regression test.

austin accepted this revision.Jul 11 2016, 2:36 PM

Wow, nice catch. I think we should definitely put the milestone on Trac #12227 for 8.0.2 for this one.

This revision is now accepted and ready to land.Jul 11 2016, 2:36 PM
This revision was automatically updated to reflect the committed changes.