Closed typeless closed 4 years ago
This is ready for review. It is not related to the heuristics but helps a lot.
I experimented with some heuristics like the q
and b
described in the paper (, Compiling Pattern Matching to Good Decision Trees by Luc Maranget). But it does not produce promising results, even slightly worse. There are probably bugs in my implementation, but I suspect that it's also related to how the string matching currently works (it dominates a lot of test nodes, which the ML languages. does not seem to have.)
It seems there is
Fixed.nameeq
, Let me change that too.
(Tested on Linux/AMD64) Sample count: 506 Dtree Refcnt avg: 5.38 95th percentile: 3.00 maximum: 100 Dtree Size avg: 5.23 95th percentile: 3.00 maximum: 84 Dtree Height avg: 1.39 95th percentile: 1.00 maximum: 12
References: Mikael Pettersson. A term pattern-match compiler inspired by finite automata theory. (p.6 "Step 3: Optimizing the DFA")