Blog post: A new general computation model for Dune

My understanding is that the implementation of watch mode in dune 2.x is notified of a change, but then needs to throws away all it knows about the rules. Rules have to be reevaluated, which should explain the delay that you’re seeing.

The plan for dune 3 (also discussed here) includes a “fast polling mode” which uses the memoization API to recompute just what is necessary.

The foundations are here and already work, but this is still incompatible with most dune features (dune features have to be written with the memoization API in mind to work, and some features predate Memo). If all goes well you should be able to get sub-300ms feedback in watch mode in dune 3 even in large repositories.