summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2015-07-06 10:46:21 +0200
committerBen Gamari <ben@smart-cactus.org>2015-07-06 10:46:22 +0200
commit4681f55970cabc6e33591d7e698621580818f9a2 (patch)
tree0d9dc8e44549e7dab2881efcfcd60c6f7aa7770e /compiler/parser
parent7a3d85e705665fbf2c28f83bb3997e8979f2b88c (diff)
downloadhaskell-4681f55970cabc6e33591d7e698621580818f9a2.tar.gz
Specialise: Avoid unnecessary recomputation of free variable information
When examining compile times for code with large ADTs (particularly those with many record constructors), I found that the specialiser contributed disproportionately to the compiler runtime. Some profiling suggested that the a great deal of time was being spent in `pair_fvs` being called from `consDictBind`. @simonpj pointed out that `flattenDictBinds` as called by `specBind` was unnecessarily discarding cached free variable information, which then needed to be recomputed by `pair_fvs`. Here I refactor the specializer to retain the free variable cache whenever possible. **Open Qustions** * I used `fst` in a couple of places to extract the bindings from a `DictBind`. Perhaps this is a sign that `DictBind` has outgrown its type synonym status? Test Plan: validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie, bgamari, simonpj Differential Revision: https://phabricator.haskell.org/D1012 GHC Trac Issues: #7450
Diffstat (limited to 'compiler/parser')
0 files changed, 0 insertions, 0 deletions