D538 and compiler performance spec

Simon Peyton Jones simonpj at microsoft.com
Fri Dec 12 21:03:26 UTC 2014


I am now adding an `AnnVal` to every RdrName, to be able to separate it out from any decoration, such as surrounding backticks or parens.

That seems like overkill to me.  (a `op` b) is an HsOpApp, and must of course have backticks unless op is an operator like (a + b), in which case it doesn’t.

The corner case is something like ((`op`) a b), which will parse as (HsApp (HsApp (HsVar op) (HsVar a)) (HsVar b)).  But it would be silly for us to get bent out of shape because of such a vanishingly rare corner case.  Instead, if you really want to reflect it faithfully, add a new constructor for “parens around backticks”).

Let’s only take these overheads when there is real reason to do so.

Simon

From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Alan & Kim Zimmerman
Sent: 12 December 2014 14:22
To: ghc-devs at haskell.org
Subject: D538 and compiler performance spec

For API annotations I am working in the details of RdrNames, which come in a bewildering variety of syntactic forms.
My latest change causes perf/compiler to fail, with

bytes allocated value is too high:
    Expected    parsing001(normal) bytes allocated: 587079016 +/-5%
    Lower bound parsing001(normal) bytes allocated: 557725065
    Upper bound parsing001(normal) bytes allocated: 616432967
    Actual      parsing001(normal) bytes allocated: 704940512
    Deviation   parsing001(normal) bytes allocated:      20.1 %
I am now adding an `AnnVal` to every RdrName, to be able to separate it out from any decoration, such as surrounding backticks or parens.
Is this a problem? The alternative would be to add a SourceText field to RdrName.
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20141212/cd7c2543/attachment.html>


More information about the ghc-devs mailing list