I have a small project using ghcjs, which currently has a best-case incremental recompilation time of 8 seconds, for a measly 637 lines of source code (as counted by find -L . -name '*.hs' | xargs wc -l | grep total
).
The worst offender is the final Linking client/Main.jsexe
step, which takes 3.8 seconds and happens on every incremental build.
The second worst offender is a Linking Template Haskell
step, which takes about 2 seconds. This also happens on every incremental rebuild, and it comes from having a couple foreign import javascript
declarations. Even if I move those declarations to a separate module/file which I never touch again, incremental builds from touching any file in the codebase cause this linking step to happen.
The final couple of seconds comes from actually compiling my source files. It would be great to get this down as well, but it's less of a problem.
How can I achieve a tighter compilation/feedback loop?