haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 210 forks source link

Recent hie is slow on big projects #1590

Open pacak opened 4 years ago

pacak commented 4 years ago

I'm trying to use hie on a sizeable code base - 500+ files, TH, generics, 200 fields records, etc. Very recent hie working with ghc8.8. For some reason it works much worse compared to a version compiled on 1st May 2019. + nvim, + coc. It can take up to 30 seconds or more to provide updated diagnostic or error messages. Is there a (user friendly) way to see what exactly it's doing? ghci :reload works much faster.

Added some performance details below, they are not showing much unfortunately.

mpickering commented 4 years ago

There are two methods described in the README, have you tried either?

pacak commented 4 years ago

Must be a new addition. Shame on me for making a ticket without checking first.

Will do and provide more details once I have them.

On Wed, Jan 22, 2020, 16:29 Matthew Pickering notifications@github.com wrote:

There are two methods described in the README, have you tried either?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/haskell/haskell-ide-engine/issues/1590?email_source=notifications&email_token=AAAQFI36IDD3NMVXMCZWAWLQ677V5A5CNFSM4KKAYF42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJSU7RQ#issuecomment-577064902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQFI4U2ORYUR6ZESFCJL3Q677V5ANCNFSM4KKAYF4Q .

pacak commented 4 years ago

ghc-event-analyze:

apply-refact - somewhere at the beginning, typechecks and typecheckUri seems to correspond to me adding and removing a typo. With longer typechecks probably corresponding me removing the type error. Is it checking all the things before replying with success?

GC                                 70650438595ns    70.650s
USER EVENTS (user events are corrected for GC)

ghc:apply-refact                   97138706668ns    97.139s
typecheckUri {getUri = "file://xxxxx"} 61464002930ns    61.464s
ghc:typecheck                      20704739955ns    20.705s
ghc:typecheck                      20186817473ns    20.187s
ghc:typecheck                      19592208311ns    19.592s
ghc:typecheck                        300932294ns     0.301s
ghc:typecheck                        245421097ns     0.245s
ghc:typecheck                        231702102ns     0.232s
ghc:typecheck                        220854271ns     0.221s
ghc:apply-refact                     116324309ns     0.116s
ghc:apply-refact                     113179419ns     0.113s
ghc:apply-refact                      95439653ns     0.095s
ghc:apply-refact                      95297655ns     0.095s
ghc:apply-refact                      92273196ns     0.092s
ghc:apply-refact                      91386920ns     0.091s
ide:completion                        10937429ns     0.011s
ide:completion                        10240517ns     0.010s
ide:completion                         9467734ns     0.009s
ghc:update-position                     521832ns     0.001s
ghc:update-position                     513059ns     0.001s
ghc:update-position                     487175ns     0.000s
ghc:update-position                     451138ns     0.000s
ghc:update-position                     443086ns     0.000s
ghc:update-position                     436502ns     0.000s
ghc:delete-cache                        400945ns     0.000s
ghc:init-hoogle                          28337ns     0.000s
TOTAL                             220723214007ns   220.723s
pacak commented 4 years ago

Not much interesting in produced eventlog file. Project I'm working on is not really cabal friendly so I can't do memory profiling thing. Memory usage seems sane though.