Merge: Do not compile dead modules
authorJean Privat <jean@pryen.org>
Thu, 18 Jun 2015 03:09:33 +0000 (23:09 -0400)
committerJean Privat <jean@pryen.org>
Thu, 18 Jun 2015 03:09:33 +0000 (23:09 -0400)
commitb1fff49c006fe8b8b73e1eaae2dda4daa8fbfdbe
tree49a74197a5e63782fd18395de0453ab46449f65e
parent7bc61db93e6cfc38e48f2017cabc461756b9bb4c
parent3cdbd1959e5d0eaf592ee668d509f8513b89f62d
Merge: Do not compile dead modules

Separate compilation implies that a module is compiled independently of its clients.
This point ensure us that the recompilation of programs is fast since only modified modules need to be recompiled and that modules used by multiples clients need to be compiled only once.

Unfortunately, currently an already compiled module need to still to be fully compiled in C on each compilation (avoiding doing it is a very complex matter). Fortunately, most of the compilation time is spend by the C compiler (especially when #1498) and this time is safely decimated by ccache.

However, a thing that some modules are imported by programs (thus provide declarations, introductions, importations) but are only made of method definitions that will never be executed by the program. Such a module is called a *dead* module and our static analysis RTA can approximate them.
So, now, the generation of C code for such a module is skipped (and its associated C compilation, obviously)

This will benefit mostly small programs that imports standard and other libraries but only use a small portion of them. Eg: programs in `tests/` or in `examples/rossetacode`.

For numbers, lets try with `time ./tests.sh ../examples/rosettacode/*.nit` to test the 32 (currently) programs.

* before: 30s
* after: 21s

I hope that CI servers will like what we, human masters, do for them!

Pull-Request: #1509
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
src/rapid_type_analysis.nit