bitc / hdevtools

REPO UNMAINTAINED!!! Try this: https://github.com/hdevtools/hdevtools/
MIT License
171 stars 43 forks source link

Using multiple files with same htdevtools instance #18

Open nh2 opened 11 years ago

nh2 commented 11 years ago

I am currently trying:

hdevtools check file1.hs
hdevtools check file2.hs
hdevtools check file1.hs

and realized that all benefits of hdevtools are lost: Checking file1.hs the second time creates a lot of CPU usage, not using any cached results.

Why is that?

It is also interesting that despite losing the hdevtools benefits, hdevtools still uses a lot of RAM: Loading a few hundred files easily eats up 10 GB RAM. So there seems to be some caching going on, but not actually being used.

How am I supposed to use hdevtools with multiple files?

nh2 commented 11 years ago

I've implemented this for ghc-mod; it seems quite easy to do!

https://github.com/nh2/ghc-mod/commit/3f9c1c20e92fcfa0aab3220e7e216fb9875f4a36

All that's needed is replacing GHC.setTargets [target] with GHC.setTargets targets`.

nh2 commented 11 years ago

I'm implementing this.

bitc commented 11 years ago

Hi @nh2, thanks for this.

I'm not quite sure why you were originally having problems. As you observed, hdevtools is using lots of memory, and so it should be caching file1.hs and the second call should finish immediately.

I think it would be worth investigating what's going on here...