You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the performance of typeclass inference in mathlib is still unsatisfactory. This is often because the DFS process enters a node that cannot reach the goal and does a lot of useless searching.
One solution is to adjust the instance priority so that frequent targets are reached more quickly. This can significantly improve performance overall. See previous attempts in #7873#13852#13690.
Currently, the performance of typeclass inference in mathlib is still unsatisfactory. This is often because the DFS process enters a node that cannot reach the goal and does a lot of useless searching.
One solution is to adjust the instance priority so that frequent targets are reached more quickly. This can significantly improve performance overall. See previous attempts in #7873 #13852 #13690.
Another solution is to use more mixins to avoid oversized hierarchies, but be careful that this may cause additional searching with the current synthesis algorithm. See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Ways.20to.20speed.20up.20Mathlib/near/468146934.
The following are relevant PRs or experiments.
Adjusting typeclass search paths:
extends
and change instance priority in algebra hierarchy #7873OfNat
#14712toMul
andtoAdd
instances #18464Ordered*.to*
instances #18468Normed*.to*
instances #18470Comm*.to*
instances #18472*WithOne.to*
instances #18474Adding shortcuts:
Slow mixins instances:
SMul
#13690SMul
#16607SMul
hierarchy #16646SMul
hierarchy #17410SMul
hierarchy #17411SetLike
hierarchy instances #17529SMul
instances #17530FunLike
hierarchy #17675Migrate to mixin typeclasses:
CanonicallyOrdered...
mixin #17444 (was 6326 13519)The text was updated successfully, but these errors were encountered: