ghc-imported-from icon indicating copy to clipboard operation
ghc-imported-from copied to clipboard

Slow operation

Open david-christiansen opened this issue 10 years ago • 7 comments

It sometimes takes 2-3 seconds on my machine to find the Haddock page for a particular symbol. Is this normal?

Perhaps some of the information that cabal repl provides to ghc-imported-from could be printed in the output, and then passed as command-line arguments to subsequent invocations? This would let editors cache the information on a per-buffer basis.

david-christiansen avatar Nov 20 '14 18:11 david-christiansen

Or, alternatively, perhaps this could eventually be folded back into ghc-mod, which already caches all that information?

david-christiansen avatar Nov 20 '14 19:11 david-christiansen

The slow operation is normal. Earlier versions were much slower. It does no caching at all and has to partially compile the file (to work out the imports and what symbols really mean) at every invocation. If GHC itself kept some more bookkeeping around then lookups would be very quick.

I'd be happy for ghc-imported-from to be merged into ghc-mod. I thought I'd see if the tool gains any traction before talking to the ghc-mod author.

carlohamalainen avatar Nov 23 '14 21:11 carlohamalainen

My understanding is that if it were integrated into ghc-mod as a new command, then the bookkeeping would already be done by the ghc-modi process, right? If so, I'd encourage you to merge it in sooner rather than later, as it would make both tools much more valuable.

david-christiansen avatar Nov 24 '14 19:11 david-christiansen

My understanding is that if it were integrated into ghc-mod as a new command, then the bookkeeping would already be done by the ghc-modi process, right?

I think so. I'll look into it.

carlohamalainen avatar Nov 24 '14 23:11 carlohamalainen

@carlohamalainen I'd be happy to merge this (±some cleanup) into ghc-mod if you want to shoot us a PR :3

DanielG avatar Sep 09 '15 05:09 DanielG

@DanielG I'd be happy to merge it in :) What sort of things need to be cleaned up?

carlohamalainen avatar Sep 09 '15 07:09 carlohamalainen

Oh just some refactoring and documentation so I can understand what's going on too. Last time I tried I didn't quite get it.

DanielG avatar Sep 09 '15 07:09 DanielG