How can I shorten (incremental) compilation time with ghcjs?

I have a small project using ghcjs that currently has an incremental recompilation time of 8 seconds for the exact 637 lines of source code (as calculated by find -L . -name '*.hs' | xargs wc -l | grep total ).

The worst offender is the final step of the Linking client/Main.jsexe , which takes 3.8 seconds and occurs with every incremental build.

The second worst intruder is the Linking Template Haskell step, which takes about 2 seconds. This also happens with every incremental restore, and it comes from declaring a pair of foreign import javascript . Even if I move these declarations to a separate module / file that I never touch again, incremental assemblies from touching any file in the codebase cause this linking step to happen.

Over the past couple of seconds, the actual collection of source files occurs. It would be great to do this, but that is not a problem.

How can I achieve a tougher compilation / feedback loop?

+7
haskell ghcjs
source share

No one has answered this question yet.

See related questions:

550
How can a time function exist in functional programming?
163
What kind of optimization can be expected from GHC for reliable operation?
eighteen
How to call Haskell from Javascript using GHCJS
12
Compiling a Haskell module in Javascript with ghcjs
12
Can GHCJS / Haste compile itself?
4
Object not found while compiling sample program with GHCJS
4
Can I read files in GHCJS?
2
Getting a stack for collecting GHCJS, built on the docker image using docker: true
0
How to get current time with GHCJS?
0
Including a module in haskell during ghcjs at compile time

All Articles