ghc-mod icon indicating copy to clipboard operation
ghc-mod copied to clipboard

ghc-mod takes a very long time checking a module with a module annotation

Open expipiplus1 opened this issue 7 years ago • 2 comments

It's not too bad on the below testcase, but in a larger file (90 lines) ghc-mod takes longer than my patience to terminate.

$ ghc-mod --version
ghc-mod version 5.9.0.0 compiled by GHC 8.2.2

ghc-mod revision: f638c0f925459f13cc94644109fb971aaf297947

Testcase

ok.hs

main :: IO ()
main = pure ()

bad.hs

{-# ANN module "" #-}
main :: IO ()
main = pure ()
$ time ghc-mod check ok.hs --verbose 7
info: Found no other project type, falling back to plain GHC project
VOMIT: Using the following mapped files:
VOMIT: Initializing GHC session with following options: "-i/home/j/bugs" "-i/home/j/bugs" "-global-package-db" "-user-package-db" "-Wall" "-O0" "-fno-warn-missing-home-modules"
DEBUG: initSession: Session not initialized, creating new one
VOMIT: Using the following targets: "/home/j/bugs/ok.hs"
DEBUG: loadTargets: Loading: ok.hs
DEBUG: loadTargets: filterModSums: False
DEBUG: loadTargets: Loading done
 check ok.hs --verbose 7  0.09s user 0.01s system 100% cpu 0.106 total
$ time ghc-mod check bad.hs --verbose 7
info: Found no other project type, falling back to plain GHC project
VOMIT: Using the following mapped files:
VOMIT: Initializing GHC session with following options: "-i/home/j/bugs" "-i/home/j/bugs" "-global-package-db" "-user-package-db" "-Wall" "-O0" "-fno-warn-missing-home-modules"
DEBUG: initSession: Session not initialized, creating new one
VOMIT: Using the following targets: "/home/j/bugs/bad.hs"
DEBUG: loadTargets: Loading: bad.hs
DEBUG: loadTargets: filterModSums: False
 check bad.hs --verbose 7  3.68s user 0.04s system 99% cpu 3.722 total

expipiplus1 avatar May 13 '18 10:05 expipiplus1

Can you link me to some documentation for this annotation, I'm not familiar with it at all.

DanielG avatar May 31 '18 21:05 DanielG

Sure:

https://ghc.haskell.org/trac/ghc/wiki/Annotations https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/extending_ghc.html#source-annotations

On Fri, 1 Jun 2018, 05:56 Daniel Gröber, [email protected] wrote:

Can you link me to some documentation for this annotation, I'm not familiar with it at all.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DanielG/ghc-mod/issues/936#issuecomment-393693659, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0U3Lj5HmmyQiA9-w7voNpinro_KSzEks5t4GcFgaJpZM4T8vtu .

expipiplus1 avatar Jun 01 '18 01:06 expipiplus1