Open anton-trunov opened 6 years ago
@gares I think this might be the performance issue we talked about at CIW-2018 (but I'm not sure yet, I'll try this workaround with nesting to check it).
This is due to the reduction algorithm used in rwprocess_rule
. It uses Tacred.hnf_constr
which contrarily to what its name suggests does much more than head normal form. It is an alias to whd_simpl_orelse_delta_but_fix
which comes with this comment :
(* Same as [whd_simpl] but also reduces constants that do not hide a
reducible fix, but does this reduction of constants only until it
immediately hides a non reducible fix or a cofix *)
So it is simpl, in worse.
So it is simpl, in worse.
No, it is like whd_simpl
, in worse. simpl
is like strong whd_simpl
IIRC.
Fair enough. Still, simpl
is marginally worse than whd_simpl
both in terms of code and computational complexity.
Fair enough. Still, simpl is marginally worse than whd_simpl both in terms of code and computational complexity.
No, in fact I think it is responsible for major slowdowns, because it makes whd_simpl
iterate its heuristics to know if something should be reduced or not (which sometimes can be seen only after reducing). IIRC this was one of the original motivations for implementing cbn
, but its refolding machinery is not less broken than simpl
.
Version
master (c0f74e3f967f0cc20709100091ee1a01e145f1cf)
Operating system
macOS 10.13.6
Description of the problem
rewrite
slows down from instantaneous to unbearable (75 s for a trivial goal).There is a workaround though: packing equations into nested tuples:
Is there a way of avoiding that repacking? Ideally, I'd like to simply write a linear tuple of equations.