OccName: Avoid re-encoding derived OccNames
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 8 Jul 2016 13:38:23 +0000 (15:38 +0200)
committerBen Gamari <ben@smart-cactus.org>
Fri, 8 Jul 2016 13:38:24 +0000 (15:38 +0200)
commiteb3d6595735671605c5d6294a796dc0f16f784a4
tree94d411ff1a2cf0f53ff4adb7fb6b372ecc0d8494
parentfc53d3658ad87073fbdc080f05ad3ac01d1ec59a
OccName: Avoid re-encoding derived OccNames

Previously we would form derived OccNames by first decoding the name
being derived from, manipulating it in [Char] form, and then
re-encoding. This is all very wasteful as we essentially always just
want to concatenate. Instead we now take care to form the final name
with only one concatFS.

Test Plan: Validate, examing compiler allocations

Reviewers: simonpj, austin

Reviewed By: simonpj

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2387

GHC Trac Issues: #12357
compiler/basicTypes/OccName.hs