UniFormal / MMT

The MMT Language and System
https://uniformal.github.io/
Other
68 stars 23 forks source link

build system up-to-date check should keep state #468

Open kohlhase opened 5 years ago

kohlhase commented 5 years ago

I am pretty sure that the up-to-date-check for build targets does not remember which files it has already checked. This is a problem in checking up-to-dateness of sTeX sms files. These are up-to-date, iff they are younger than the corresponding sTeX file and all dependencies are up-to-date as well. As the dependency relation on sms files is a DAG with high in-degree this makes the naive algorithm very exponential. We should keep a global list of up-to-date files in the build system to make the algorithm linear. Of course not only for sms files, but for general build targets.

I had the same problem with pdflatex on sTeX, and this measure sped up things by a factor of 10 on average.

BUT things are not so easy, sms files can become non-up-to-date, e.g. when the sTeX file is edited. Then the optimized up-to-date-check becomes unsound. There are two ways around this:

  1. have a file system listener that watches for file changes and updates the list
  2. add a OK time difference, which assumes that a file stays up-to-date for n seconds; add the last check time t to the list and trust the list only if t is younger than n seconds.
  3. like 1. but replace the listener with something triggered by a git pull event (this is relevant for the central build system).