compiler: improve `poset_from_mtypes` used for type coloring.
authorJean Privat <jean@pryen.org>
Fri, 20 Mar 2015 05:14:30 +0000 (12:14 +0700)
committerJean Privat <jean@pryen.org>
Sat, 21 Mar 2015 06:01:04 +0000 (13:01 +0700)
commit19ec2bb5866f074d8ca9e1c12da44689eae3f701
treeb5412f3922f340e3b9953bf6479e996506ec78bc
parent1d30ecd0b6da661cc26dc6b21451b6d348a88125
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%

Signed-off-by: Jean Privat <jean@pryen.org>
src/compiler/separate_compiler.nit