[GHC] #13701: GHCi 2x slower without -keep-tmp-files

GHC ghc-devs at haskell.org
Thu Jun 8 19:36:12 UTC 2017


#13701: GHCi 2x slower without -keep-tmp-files
-------------------------------------+-------------------------------------
        Reporter:  niteria           |                Owner:  duog
            Type:  task              |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3620
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"3ee3822ce588565e912ab6211e9d2cd545fc6ba6/ghc"
 3ee3822c/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="3ee3822ce588565e912ab6211e9d2cd545fc6ba6"
 Refactor temp files cleanup

 Remove filesToNotIntermediateClean from DynFlags, create a data type
 FilesToClean, and change filesToClean in DynFlags to be a FilesToClean.

 Modify SysTools.newTempName and the Temporary constructor of
 PipelineMonad.PipelineOutput to take a TempFileLifetime, which specifies
 whether a temp file should live until the end of GhcMonad.withSession,
 or until the next time cleanIntermediateTempFiles is called.

 These changes allow the cleaning of intermediate files in GhcMake to be
 much more efficient.

 HscTypes.hptObjs is removed as it is no longer used.

 A new performance test T13701 is added, which passes both with and
 without -keep-tmp-files.  The test fails by 25% without the patch, and
 passes when -keep-tmp-files is added.

 Note that there are still at two hotspots caused by
 algorithms quadratic in the number of modules, however neither of them
 allocate. They are:

 * DriverPipeline.compileOne'.needsLinker
 * GhcMake.getModLoop

 DriverPipeline.compileOne'.needsLinker is changed slightly to improve
 the situation.

 I don't like adding these Types to DynFlags, but they need to be seen by
 Dynflags, SysTools and PipelineMonad. The alternative seems to be to
 create a new module.

 Reviewers: austin, hvr, bgamari, dfeuer, niteria, simonmar, erikd

 Reviewed By: simonmar

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #13701

 Differential Revision: https://phabricator.haskell.org/D3620
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13701#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list