[Merged by Bors] - perf: reduce instance priority of Complex.instSMulRealComplex#12070
Closed
MichaelStollBayreuth wants to merge 2 commits intomasterfrom
Closed
[Merged by Bors] - perf: reduce instance priority of Complex.instSMulRealComplex#12070MichaelStollBayreuth wants to merge 2 commits intomasterfrom
Complex.instSMulRealComplex#12070MichaelStollBayreuth wants to merge 2 commits intomasterfrom
Conversation
Contributor
Author
|
!bench |
Collaborator
|
Here are the benchmark results for commit 9855297. Benchmark Metric Change
=======================================================================
+ ~Mathlib.NumberTheory.ModularForms.Basic instructions -29.9%
+ ~Mathlib.NumberTheory.ModularForms.SlashActions instructions -16.4% |
Contributor
|
Can you add a reference in the file to issue #11692? |
Contributor
Author
|
Done (also added a comment). Can you check that it is what you suggest? |
Contributor
|
LGTM. Please merge when the CI finishes. Thanks. bors delegate+ |
Contributor
|
✌️ MichaelStollBayreuth can now approve this pull request. To approve and merge a pull request, simply reply with |
Contributor
|
bors merge |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Apr 12, 2024
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432760180) on Zulip. We reduce the instance priority of `Complex.instSMulRealComplex` to 90. This leads to a very significant speed-up in two Modular Forms files (and still noticeable speed-ups in some other files).
Contributor
|
Pull request successfully merged into master. Build succeeded: |
Complex.instSMulRealComplexComplex.instSMulRealComplex
mathlib-bors bot
pushed a commit
that referenced
this pull request
Apr 14, 2024
This scopes and moves to `Complex.SMul` the instance `instSMulRealComplex`.
Rationale: This instance is used in `Data.Complex.{Basic|Module}` to bootstrap `SMul` instances from the reals, but afterwards, instances `SMul R ℂ` should not need to rely on that (rather be obtained via `Algebra R ℂ`, for example). This speeds up the two mentioned files a bit (in fact, it reverts a slow-down caused by reducing the instance priority in #12070) and does not seem to have any adverse effects.
I think this is a cleaner solution compared to just reducing the instance priority.
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432855625) on Zulip.
xgenereux
pushed a commit
that referenced
this pull request
Apr 15, 2024
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432760180) on Zulip. We reduce the instance priority of `Complex.instSMulRealComplex` to 90. This leads to a very significant speed-up in two Modular Forms files (and still noticeable speed-ups in some other files).
xgenereux
pushed a commit
that referenced
this pull request
Apr 15, 2024
This scopes and moves to `Complex.SMul` the instance `instSMulRealComplex`.
Rationale: This instance is used in `Data.Complex.{Basic|Module}` to bootstrap `SMul` instances from the reals, but afterwards, instances `SMul R ℂ` should not need to rely on that (rather be obtained via `Algebra R ℂ`, for example). This speeds up the two mentioned files a bit (in fact, it reverts a slow-down caused by reducing the instance priority in #12070) and does not seem to have any adverse effects.
I think this is a cleaner solution compared to just reducing the instance priority.
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432855625) on Zulip.
atarnoam
pushed a commit
that referenced
this pull request
Apr 16, 2024
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432760180) on Zulip. We reduce the instance priority of `Complex.instSMulRealComplex` to 90. This leads to a very significant speed-up in two Modular Forms files (and still noticeable speed-ups in some other files).
atarnoam
pushed a commit
that referenced
this pull request
Apr 16, 2024
This scopes and moves to `Complex.SMul` the instance `instSMulRealComplex`.
Rationale: This instance is used in `Data.Complex.{Basic|Module}` to bootstrap `SMul` instances from the reals, but afterwards, instances `SMul R ℂ` should not need to rely on that (rather be obtained via `Algebra R ℂ`, for example). This speeds up the two mentioned files a bit (in fact, it reverts a slow-down caused by reducing the instance priority in #12070) and does not seem to have any adverse effects.
I think this is a cleaner solution compared to just reducing the instance priority.
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432855625) on Zulip.
uniwuni
pushed a commit
that referenced
this pull request
Apr 19, 2024
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432760180) on Zulip. We reduce the instance priority of `Complex.instSMulRealComplex` to 90. This leads to a very significant speed-up in two Modular Forms files (and still noticeable speed-ups in some other files).
uniwuni
pushed a commit
that referenced
this pull request
Apr 19, 2024
This scopes and moves to `Complex.SMul` the instance `instSMulRealComplex`.
Rationale: This instance is used in `Data.Complex.{Basic|Module}` to bootstrap `SMul` instances from the reals, but afterwards, instances `SMul R ℂ` should not need to rely on that (rather be obtained via `Algebra R ℂ`, for example). This speeds up the two mentioned files a bit (in fact, it reverts a slow-down caused by reducing the instance priority in #12070) and does not seem to have any adverse effects.
I think this is a cleaner solution compared to just reducing the instance priority.
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432855625) on Zulip.
callesonne
pushed a commit
that referenced
this pull request
Apr 22, 2024
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432760180) on Zulip. We reduce the instance priority of `Complex.instSMulRealComplex` to 90. This leads to a very significant speed-up in two Modular Forms files (and still noticeable speed-ups in some other files).
callesonne
pushed a commit
that referenced
this pull request
Apr 22, 2024
This scopes and moves to `Complex.SMul` the instance `instSMulRealComplex`.
Rationale: This instance is used in `Data.Complex.{Basic|Module}` to bootstrap `SMul` instances from the reals, but afterwards, instances `SMul R ℂ` should not need to rely on that (rather be obtained via `Algebra R ℂ`, for example). This speeds up the two mentioned files a bit (in fact, it reverts a slow-down caused by reducing the instance priority in #12070) and does not seem to have any adverse effects.
I think this is a cleaner solution compared to just reducing the instance priority.
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432855625) on Zulip.
Jun2M
pushed a commit
that referenced
this pull request
Apr 24, 2024
This scopes and moves to `Complex.SMul` the instance `instSMulRealComplex`.
Rationale: This instance is used in `Data.Complex.{Basic|Module}` to bootstrap `SMul` instances from the reals, but afterwards, instances `SMul R ℂ` should not need to rely on that (rather be obtained via `Algebra R ℂ`, for example). This speeds up the two mentioned files a bit (in fact, it reverts a slow-down caused by reducing the instance priority in #12070) and does not seem to have any adverse effects.
I think this is a cleaner solution compared to just reducing the instance priority.
See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20prefers.20CharP.2Ecast_eq_zero.20over.20Nat.2Ecast_zero/near/432855625) on Zulip.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See here on Zulip.
We reduce the instance priority of
Complex.instSMulRealComplexto 90. This leads to a very significant speed-up in two Modular Forms files (and still noticeable speed-ups in some other files).