Repository navigation
perf(CategoryTheory): write down some universe parameters explicitly - #46147
felixpernegger wants to merge 2 commits into
Conversation
felixpernegger
commented
Nov 18, 2026
|
!bench |
|
Benchmark results for 74407c5 against 5198ccc are in. There are significant results. @felixpernegger
Large changes (4✅)
Medium changes (1✅)
Small changes (1✅, 5🟥)
|
PR summary 74407c5171Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
Ouch. How did you find those? Do you have a rationale and why they help? Ideally, such annotations should not be needed: is this a problem that we could potentially minimize and bring to the attention of lean core? (To clarify: we should definitely take this improvement but having to manually find and write these is tedious and doesn’t give us much insight on how not to repeat the pattern inadvertently) |
By looking at the slowest files per line in mathlib I don't have a great understanding into this, but afaik, one should avoid free universe levels, as lean is very ineffective plugging those in sometimes, see #40964 |
|
But the universe levels you added are not really "free": What’s weird to me is that the problematic universe level is the third (i.e. the one you can guess from the type the fastest!): in But then if you hover on the |
|
It looks like this is the "universe level variables like being sorted alphabetically" quirk again: still in We merged #26008, and then later on #34088, which are basically instances of this. |
|
Thanks for the analysis :) |
|
Given that you’ve said on Zulip that these are the only three files where perfomances tricks like this seem to have an effect, let’s move on with this and take the speedup. Thanks! maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by robin-carlier. |