Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving the performance of typeclass inference #16644

Open
8 of 18 tasks
FR-vdash-bot opened this issue Sep 9, 2024 · 0 comments
Open
8 of 18 tasks

Improving the performance of typeclass inference #16644

FR-vdash-bot opened this issue Sep 9, 2024 · 0 comments

Comments

@FR-vdash-bot
Copy link
Collaborator

FR-vdash-bot commented Sep 9, 2024

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:

Adding shortcuts:

Slow mixins instances:

Migrate to mixin typeclasses:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant