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
[Merged by Bors] - feat: FastSubsingleton
and FastIsEmpty
to speed up congr!
/convert
#12495
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ert` Introduces two typeclasses that are meant to quickly evaluate whether a particular type is a subsingleton. Local `Subsingleton`/`IsEmpty` instances are included as `Fast` instances, so to get `congr!`/`convert` to reason about subsingleton types, you can add such instances to the local context.
!bench |
Here are the benchmark results for commit 741947e. Benchmark Metric Change
====================================================================================
+ ~Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties instructions -2.9%
+ ~Mathlib.Analysis.Calculus.ContDiff.Basic instructions -6.8%
+ ~Mathlib.Analysis.Calculus.ContDiff.Defs instructions -4.6%
+ ~Mathlib.Analysis.Calculus.FDeriv.Analytic instructions -9.3%
+ ~Mathlib.Analysis.Fourier.PoissonSummation instructions -31.7%
+ ~Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform instructions -16.4%
+ ~Mathlib.Geometry.Manifold.Instances.Sphere instructions -13.4%
+ ~Mathlib.Geometry.Manifold.IntegralCurve instructions -20.1%
+ ~Mathlib.LinearAlgebra.AffineSpace.Independent instructions -18.4%
+ ~Mathlib.NumberTheory.Modular instructions -15.1%
+ ~Mathlib.NumberTheory.ZetaValues instructions -16.9% |
kmill
added
awaiting-review
The author would like community review of the PR
t-meta
Tactics, attributes or user commands
labels
Apr 29, 2024
Thanks, I think this great, since I've also noticed these tactics to be often slow. bors merge |
github-actions
bot
added
ready-to-merge
This PR has been sent to bors.
and removed
awaiting-review
The author would like community review of the PR
labels
Apr 29, 2024
mathlib-bors bot
pushed a commit
that referenced
this pull request
Apr 29, 2024
…ert` (#12495) This is a PR that's a temporary measure to improve performance of `congr!`/`convert`, and the implementation may change in a future PR with a new version of `congr!`. Introduces two typeclasses that are meant to quickly evaluate in common cases of `Subsingleton` and `IsEmpty`. Makes `congr!` use these typeclasses rather than `Subsingleton`. Local `Subsingleton`/`IsEmpty` instances are included as `Fast` instances. To get `congr!`/`convert` to reason about subsingleton types, you can add such instances to the local context. Or, you can `apply Subsingleton.elim` yourself. [Zulip discussion](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/convert.20is.20often.20slow/near/433830798)
Pull request successfully merged into master. Build succeeded: |
mathlib-bors
bot
changed the title
feat:
[Merged by Bors] - feat: Apr 29, 2024
FastSubsingleton
and FastIsEmpty
to speed up congr!
/convert
FastSubsingleton
and FastIsEmpty
to speed up congr!
/convert
apnelson1
pushed a commit
that referenced
this pull request
May 12, 2024
…ert` (#12495) This is a PR that's a temporary measure to improve performance of `congr!`/`convert`, and the implementation may change in a future PR with a new version of `congr!`. Introduces two typeclasses that are meant to quickly evaluate in common cases of `Subsingleton` and `IsEmpty`. Makes `congr!` use these typeclasses rather than `Subsingleton`. Local `Subsingleton`/`IsEmpty` instances are included as `Fast` instances. To get `congr!`/`convert` to reason about subsingleton types, you can add such instances to the local context. Or, you can `apply Subsingleton.elim` yourself. [Zulip discussion](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/convert.20is.20often.20slow/near/433830798)
callesonne
pushed a commit
that referenced
this pull request
May 16, 2024
…ert` (#12495) This is a PR that's a temporary measure to improve performance of `congr!`/`convert`, and the implementation may change in a future PR with a new version of `congr!`. Introduces two typeclasses that are meant to quickly evaluate in common cases of `Subsingleton` and `IsEmpty`. Makes `congr!` use these typeclasses rather than `Subsingleton`. Local `Subsingleton`/`IsEmpty` instances are included as `Fast` instances. To get `congr!`/`convert` to reason about subsingleton types, you can add such instances to the local context. Or, you can `apply Subsingleton.elim` yourself. [Zulip discussion](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/convert.20is.20often.20slow/near/433830798)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a PR that's a temporary measure to improve performance of
congr!
/convert
, and the implementation may change in a future PR with a new version ofcongr!
.Introduces two typeclasses that are meant to quickly evaluate in common cases of
Subsingleton
andIsEmpty
. Makescongr!
use these typeclasses rather thanSubsingleton
.Local
Subsingleton
/IsEmpty
instances are included asFast
instances. To getcongr!
/convert
to reason about subsingleton types, you can add such instances to the local context. Or, you canapply Subsingleton.elim
yourself.Zulip discussion