[commit: ghc] master: Rework parsing of Cabal metadata (#692) (7169ac5)

git at git.haskell.org git at git.haskell.org
Tue Oct 23 20:20:45 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7169ac5d7b03f1ed5fbb05514352c0fdeb16429b/ghc

>---------------------------------------------------------------

commit 7169ac5d7b03f1ed5fbb05514352c0fdeb16429b
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sat Sep 29 11:43:17 2018 +0100

    Rework parsing of Cabal metadata (#692)
    
    The current implementation of parsing Cabal data is a big mess, which affects performance as described in #671 and #550. In this PR we simplify the implementation and avoid unnecessary reparsing.
    
    As a result, the zero build time is reduced from 30 seconds to 5 seconds on my machine. The full build time seems to have been improved as well, since now all CI bots complete within the time limit. On the other hand, the speed up of the full build with `-j` on my machine does not appear to be significant.


>---------------------------------------------------------------

7169ac5d7b03f1ed5fbb05514352c0fdeb16429b
 hadrian.cabal                            |  10 +-
 src/Context.hs                           |   6 +-
 src/Expression.hs                        |  14 +--
 src/Hadrian/Expression.hs                |   2 +-
 src/Hadrian/Haskell/Cabal.hs             |  41 ++++---
 src/Hadrian/Haskell/Cabal/CabalData.hs   |  24 -----
 src/Hadrian/Haskell/Cabal/PackageData.hs |  46 --------
 src/Hadrian/Haskell/Cabal/Parse.hs       | 180 +++++++++++++++----------------
 src/Hadrian/Haskell/Cabal/Type.hs        |  75 +++++++++++++
 src/Hadrian/Oracles/Cabal.hs             |  41 +++++++
 src/Hadrian/Oracles/Cabal/Rules.hs       |  63 +++++++++++
 src/Hadrian/Oracles/Cabal/Type.hs        |  62 +++++++++++
 src/Hadrian/Oracles/Path.hs              |   4 +-
 src/Hadrian/Oracles/TextFile.hs          |  70 ++++++++----
 src/Hadrian/Oracles/TextFile/Rules.hs    |  63 -----------
 src/Hadrian/Oracles/TextFile/Type.hs     |  41 -------
 src/Oracles/ModuleFiles.hs               |  16 +--
 src/Rules.hs                             |   6 +-
 src/Rules/BinaryDist.hs                  |   2 +-
 src/Rules/Documentation.hs               |  11 +-
 src/Rules/Library.hs                     |   8 +-
 src/Rules/Program.hs                     |   6 +-
 src/Rules/Selftest.hs                    |   4 +-
 src/Settings/Builders/Cabal.hs           |   3 +-
 src/Settings/Builders/Cc.hs              |   4 +-
 src/Settings/Builders/Common.hs          |   6 +-
 src/Settings/Builders/Ghc.hs             |  16 +--
 src/Settings/Builders/Haddock.hs         |  12 +--
 src/Settings/Builders/Hsc2Hs.hs          |  12 +--
 src/Settings/Default.hs                  |   4 +-
 src/Utilities.hs                         |  16 +--
 stack.yaml                               |   5 +-
 32 files changed, 484 insertions(+), 389 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 7169ac5d7b03f1ed5fbb05514352c0fdeb16429b


More information about the ghc-commits mailing list