Hi Miguel,
Yes! I think that's a great idea. I've been profiling the code and adding statistics, taking care of the obvious hot spots, but unreachability is still quite expensive.
Today is the last time I can work on this, though, since I need to finish other stuff that's on the critical path to M4.
My current plan is to merge what I have in trunk, but implement a cop out command-line switch for those who don't want the overhead. (Note: you won't see this overhead in interactive uses any way, since eclipse stops after typers.)
I think these analyses are too useful to be off by default. (Of course i'd say that, since I've been slaving over them over the last weeks.)
Happy to hear you opinion.
Here's a breakdown for compiling the top-20 users of pattern matching in the compiler sources (decided by grepping for 'match')
for reference:
[scalacfork] time spent typechecking : 1 spans, 19.033845000s (100.0%)
[scalacfork] *** Cumulative statistics at phase patmat
[scalacfork] #typechecked identifiers : 132479
[scalacfork] #typechecked selections : 92802
[scalacfork] #typechecked applications: 67565
[scalacfork] time spent in patmat : 1989 spans, 3.005118000s
[scalacfork] of which DPLL : 32140 spans, 0.492350000s (16.4%)
[scalacfork] of which variable equality : 2899 spans, 0.323131000s (10.8%) -- this is the most expensive part of setting up the propositions, translating T <: C constraints into boolean propositions
[scalacfork] of which in exhaustivity : 338 spans, 0.190358000s (6.3%)
[scalacfork] of which in unreachability : 1298 spans, 1.302371000s (43.3%)