Skip to content

perf (MonoidAlgebra.Basic): reduce withs in structure terms#6319

Closed
mattrobball wants to merge 3 commits intomasterfrom
mrb/monalg_withs
Closed

perf (MonoidAlgebra.Basic): reduce withs in structure terms#6319
mattrobball wants to merge 3 commits intomasterfrom
mrb/monalg_withs

Conversation

@mattrobball
Copy link
Copy Markdown
Contributor


Open in Gitpod

@mattrobball
Copy link
Copy Markdown
Contributor Author

!bench

Comment on lines +297 to +298
{ liftNC (f : k →+ R) g with
toFun := liftNC (f : k →+ R) g
map_one' := liftNC_one _ _
map_mul' := fun _a _b => liftNC_mul _ _ _ _ fun {_ _} _ => h_comm _ _ }
-- { toMonoidHom :=liftNC (f : k →+ R) g with
{ toMonoidHom := {
toFun := liftNC (f : k →+ R) g
map_one' := liftNC_one _ _
map_mul' := fun _a _b => liftNC_mul _ _ _ _ fun {_ _} _ => h_comm _ _ }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this generate an identical term?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so but didn't check

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit bc87b03.
There were significant changes against commit a3b98ba:

  Benchmark                                              Metric         Change
  ============================================================================
+ ~Mathlib.Algebra.Category.Ring.Adjunctions             instructions   -10.6%
+ ~Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra          instructions   -11.9%
+ ~Mathlib.Algebra.Lie.Free                              instructions    -5.5%
+ ~Mathlib.Algebra.MonoidAlgebra.Basic                   instructions    -5.2%
+ ~Mathlib.Algebra.MonoidAlgebra.Grading                 instructions   -17.3%
+ ~Mathlib.Algebra.MonoidAlgebra.Ideal                   instructions    -5.0%
+ ~Mathlib.AlgebraicGeometry.EllipticCurve.Point         instructions    -9.3%
+ ~Mathlib.Data.MvPolynomial.Derivation                  instructions    -6.7%
+ ~Mathlib.Data.MvPolynomial.Division                    instructions    -8.2%
+ ~Mathlib.Data.MvPolynomial.Equiv                       instructions    -6.5%
+ ~Mathlib.Data.MvPolynomial.Funext                      instructions    -9.1%
+ ~Mathlib.Data.MvPolynomial.Supported                   instructions    -7.5%
+ ~Mathlib.Data.Polynomial.Monomial                      instructions   -10.2%
+ ~Mathlib.FieldTheory.AbelRuffini                       instructions   -12.6%
+ ~Mathlib.FieldTheory.Cardinality                       instructions   -62.4%
+ ~Mathlib.FieldTheory.Finite.Polynomial                 instructions    -7.4%
+ ~Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure      instructions   -24.2%
+ ~Mathlib.FieldTheory.MvPolynomial                      instructions   -27.1%
+ ~Mathlib.FieldTheory.PolynomialGaloisGroup             instructions   -30.6%
+ ~Mathlib.FieldTheory.RatFunc                           instructions    -5.1%
+ ~Mathlib.FieldTheory.SplittingField.Construction       instructions   -44.6%
+ ~Mathlib.LinearAlgebra.Matrix.Adjugate                 instructions   -10.9%
+ ~Mathlib.LinearAlgebra.Matrix.MvPolynomial             instructions   -11.4%
+ ~Mathlib.NumberTheory.LegendreSymbol.AddCharacter      instructions   -25.5%
+ ~Mathlib.NumberTheory.LegendreSymbol.GaussSum          instructions   -25.3%
+ ~Mathlib.RepresentationTheory.Maschke                  instructions   -10.0%
+ ~Mathlib.RingTheory.AlgebraicIndependent               instructions    -5.6%
+ ~Mathlib.RingTheory.FinitePresentation                 instructions   -45.3%
+ ~Mathlib.RingTheory.FiniteType                         instructions   -14.7%
+ ~Mathlib.RingTheory.Jacobson                           instructions    -9.3%
+ ~Mathlib.RingTheory.MvPolynomial.Homogeneous           instructions    -9.5%
+ ~Mathlib.RingTheory.MvPolynomial.Ideal                 instructions    -7.6%
+ ~Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous   instructions    -5.1%
+ ~Mathlib.RingTheory.Nullstellensatz                    instructions   -53.0%
+ ~Mathlib.RingTheory.Polynomial.Basic                   instructions   -12.8%
+ ~Mathlib.RingTheory.Polynomial.GaussLemma              instructions    -8.2%
+ ~Mathlib.RingTheory.Polynomial.Quotient                instructions   -17.3%
+ ~Mathlib.RingTheory.RootsOfUnity.Minpoly               instructions   -36.3%
+ ~Mathlib.RingTheory.WittVector.Basic                   instructions   -10.4%
+ ~Mathlib.RingTheory.WittVector.Defs                    instructions   -14.4%
+ ~Mathlib.RingTheory.WittVector.Frobenius               instructions    -5.9%
+ ~Mathlib.RingTheory.WittVector.MulP                    instructions    -8.2%
+ ~Mathlib.RingTheory.WittVector.StructurePolynomial     instructions    -8.3%
+ ~Mathlib.RingTheory.WittVector.Teichmuller             instructions   -30.0%
+ ~Mathlib.RingTheory.WittVector.WittPolynomial          instructions   -11.5%

@mattrobball
Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 0d13ae5.
There were significant changes against commit a3b98ba:

  Benchmark                                              Metric         Change
  ============================================================================
+ ~Mathlib.Algebra.Category.Ring.Adjunctions             instructions   -12.9%
+ ~Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra          instructions   -11.9%
+ ~Mathlib.Algebra.Lie.Free                              instructions    -5.6%
+ ~Mathlib.Algebra.MonoidAlgebra.Basic                   instructions    -6.4%
+ ~Mathlib.Algebra.MonoidAlgebra.Grading                 instructions   -17.7%
+ ~Mathlib.AlgebraicGeometry.EllipticCurve.Point         instructions    -9.8%
+ ~Mathlib.Data.MvPolynomial.Derivation                  instructions    -6.6%
+ ~Mathlib.Data.MvPolynomial.Division                    instructions    -8.1%
+ ~Mathlib.Data.MvPolynomial.Equiv                       instructions    -6.4%
+ ~Mathlib.Data.MvPolynomial.Funext                      instructions    -9.7%
+ ~Mathlib.Data.MvPolynomial.Supported                   instructions    -7.5%
+ ~Mathlib.Data.Polynomial.Monomial                      instructions   -10.6%
+ ~Mathlib.FieldTheory.AbelRuffini                       instructions   -13.1%
+ ~Mathlib.FieldTheory.Cardinality                       instructions   -63.1%
+ ~Mathlib.FieldTheory.Finite.Polynomial                 instructions    -7.2%
+ ~Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure      instructions   -26.2%
+ ~Mathlib.FieldTheory.MvPolynomial                      instructions   -29.3%
+ ~Mathlib.FieldTheory.PolynomialGaloisGroup             instructions   -31.7%
+ ~Mathlib.FieldTheory.RatFunc                           instructions    -5.2%
+ ~Mathlib.FieldTheory.SplittingField.Construction       instructions   -46.3%
+ ~Mathlib.LinearAlgebra.Matrix.Adjugate                 instructions   -11.9%
+ ~Mathlib.LinearAlgebra.Matrix.MvPolynomial             instructions   -11.5%
+ ~Mathlib.NumberTheory.LegendreSymbol.AddCharacter      instructions   -26.1%
+ ~Mathlib.NumberTheory.LegendreSymbol.GaussSum          instructions   -31.2%
+ ~Mathlib.RepresentationTheory.Maschke                  instructions   -13.0%
+ ~Mathlib.RingTheory.AlgebraicIndependent               instructions    -5.7%
+ ~Mathlib.RingTheory.FinitePresentation                 instructions   -46.2%
+ ~Mathlib.RingTheory.FiniteType                         instructions   -16.6%
+ ~Mathlib.RingTheory.Jacobson                           instructions   -10.0%
+ ~Mathlib.RingTheory.MvPolynomial.Homogeneous           instructions    -9.4%
+ ~Mathlib.RingTheory.MvPolynomial.Ideal                 instructions    -7.6%
+ ~Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous   instructions    -5.1%
+ ~Mathlib.RingTheory.Nullstellensatz                    instructions   -59.7%
+ ~Mathlib.RingTheory.Polynomial.Basic                   instructions   -13.3%
+ ~Mathlib.RingTheory.Polynomial.GaussLemma              instructions   -10.5%
+ ~Mathlib.RingTheory.Polynomial.Quotient                instructions   -18.7%
+ ~Mathlib.RingTheory.RootsOfUnity.Minpoly               instructions   -36.3%
+ ~Mathlib.RingTheory.WittVector.Basic                   instructions   -11.9%
+ ~Mathlib.RingTheory.WittVector.Defs                    instructions   -14.8%
+ ~Mathlib.RingTheory.WittVector.Frobenius               instructions    -5.7%
+ ~Mathlib.RingTheory.WittVector.MulP                    instructions    -8.1%
+ ~Mathlib.RingTheory.WittVector.StructurePolynomial     instructions    -8.1%
+ ~Mathlib.RingTheory.WittVector.Teichmuller             instructions   -31.7%
+ ~Mathlib.RingTheory.WittVector.WittPolynomial          instructions   -11.4%

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Aug 6, 2023

(Just a reminder that on the mathlib4 repo, if authors don't self-label with awaiting-review, PRs don't appear on the #queue and might never be noticed. :-)

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 14, 2023
@mattrobball mattrobball reopened this Aug 29, 2023
@mattrobball mattrobball deleted the mrb/monalg_withs branch January 22, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants