chore: remove CoeFun instances where FunLike is available#17921
chore: remove CoeFun instances where FunLike is available#17921Vierkantor wants to merge 2 commits intomasterfrom
Conversation
|
!bench |
PR summary acdbe3f73aImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
Here are the benchmark results for commit 7254b21. Benchmark Metric Change
===================================================================
- ~Mathlib.Analysis.InnerProductSpace.Adjoint instructions 8.5% |
a142021 to
7339c6f
Compare
|
This PR/issue depends on: |
7339c6f to
8aa42b2
Compare
|
!bench |
|
Here are the benchmark results for commit 8aa42b2. Benchmark Metric Change
===================================================================
- ~Mathlib.Analysis.InnerProductSpace.Adjoint instructions 8.3% |
|
Huh! My suspicion was on |
During the port we found that `FunLike` is robust enough not to need an extra `CoeFun` shortcut. Let's see if that rule can be consistently applied to the whole of the library. There is still duplication between `FunLike` and `CoeFun` for `Grp`, `Mon`, `CommGrp` and `CommMon`, which will need a more thorough fix. See also #17866. Compared to previous tests, this only preserves the `Finsupp` and `DFinsupp` instances; my guess is that they are the important shortcut instances preventing slowdowns.
8aa42b2 to
acdbe3f
Compare
|
!bench |
|
Here are the benchmark results for commit acdbe3f. |
|
Okay then! Looks like we got the culprit: instance instCoeFun : CoeFun (E ≃ₛₗᵢ[σ₁₂] E₂) fun _ ↦ E → E₂ := ⟨DFunLike.coe⟩Not sure why this is particularly slow to apply... But that's to figure out for later. I'll get the main PR ready to merge. |
During the port we found that
FunLikeis robust enough not to need an extraCoeFunshortcut. Let's see if that rule can be consistently applied to the whole of the library.There is still duplication between
FunLikeandCoeFunforGrp,Mon,CommGrpandCommMon, which will need a more thorough fix. See also #17866.I am currently bisecting #17870 to figure out exactly why the benchmarks are indicating a slowdown with no obvious cause.
CoeFuninstances whereFunLikeis available #17917