Various performance improvements in handling SourceNotes
Needs RevisionPublic

Authored by bgamari on Jan 24 2017, 10:28 AM.

Details

Reviewers
simonmar
dfeuer
austin
Trac Issues
#11095
Summary

This reworks the SourceNote infrastructure to improve allocation
behavior (eliminating Strings in favor of FastStrings to ease load on the
garbage collector and cheapen comparison) and improve asymptotic behavior
(reducing the size of a list given to nub).

Test Plan

Compare compiler performance on testcase in Trac #11095.

bgamari updated this revision to Diff 10668.Jan 24 2017, 10:28 AM
bgamari retitled this revision from to Various performance improvements in handling SourceNotes.
bgamari updated this object.
bgamari edited the test plan for this revision. (Show Details)
bgamari updated the Trac tickets for this revision.
niteria added inline comments.
compiler/cmm/Debug.hs
188

Careful, this could introduce nondeterminism.

compiler/utils/FastStringEnv.hs
80

This can introduce nondeterminism, if we're reintroducing it, let's call it nonDetEltsEnv and let's put an explanation for why its usage might be OK at the callsite.

dfeuer added a subscriber: dfeuer.Feb 22 2017, 6:18 PM
dfeuer added inline comments.
compiler/cmm/Debug.hs
189

nubBy is generally pretty crummy. Could you use a sorting version?

dfeuer requested changes to this revision.Mar 17 2017, 5:10 PM

Do you have any measurements of the effect this has? This may need to be rebased to accommodate Simon's work.

This revision now requires changes to proceed.Mar 17 2017, 5:10 PM
austin resigned from this revision.Nov 9 2017, 11:33 AM