Merge: compiler: improve `poset_from_mtypes` used for type coloring.
authorJean Privat <jean@pryen.org>
Sat, 21 Mar 2015 06:13:27 +0000 (13:13 +0700)
committerJean Privat <jean@pryen.org>
Sat, 21 Mar 2015 06:13:27 +0000 (13:13 +0700)
commit2091a6f0d0f4fea6f1f8c2131d336d49547b55aa
treeea75cadf7f729b9e0af348224f41189530ecf89a
parent0774e146471ac60d5456f64272a63228b5f0b053
parente19268a8c2bd866cd07d31a75f2ca6fe63883a93
Merge: compiler: improve `poset_from_mtypes` used for type coloring.

Instead of doing the full matrix mtypes X cast_types, a grouping is done by the base classes of the types so that we compare only types whose base classes are in inheritance.

For nitc/nitc/nitc the result is not that bad:

before:
0m6.584s
17.605 GIr
time passed in poset_from_mtypes: 26.01% (4.579 GIr)

now:
0m5.880s (-10%)
15.088 GIr (-14%)
time passed in poset_from_mtypes: 11.72% (1.768 GIr)

In the best condition, I can now expect to compile in less than 6s.

Note that coloring is still a MAJOR issue in term of compile time since 1/4 of the Ir are used to compute coloration.

 * type_coloring: 17.23%
 * property_coloring: 9.35%

Pull-Request: #1212
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
src/compiler/separate_compiler.nit