Profiling `dune build -w`

Is it possible to tell dune build -w to dump profiling data ?

In particular, on every recompile, dump:

  1. X = list of all dune libs recompiled

  2. for each x in X, dump the time it took to recompile x

  3. for each x in X, dump the ancestor (dependencies) of x


You could look at dune’s tracing info. It includes timing of the commands that dune runs. Might have what you need.

1 Like

Along the same lines, is there anything I can modify in following dune file to speed up dune build -w ?

   (compilation_mode separate)
    (:standard --no-source-map --target-env=browser))
   (build_runtime_flags (:standard)))))

Depending on whether you need everything or just typechecking for quicker dev, you could run dune build @check -w. Often I will do this for a while when iterating on something, then switch to an actual build when needed.