-
Notifications
You must be signed in to change notification settings - Fork 451
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
feat: lake: save elaborated config as an olean #2480
Conversation
cfdf918
to
b74f52f
Compare
While I would like a review, merging should wait until this is tested against benchmarks like #2457. |
!bench |
Here are the benchmark results for commit fda7e93. |
Comparing this benchmark with the plain one in #2457 (comment) displays the expected significant improvement to configuration time. From the comparison: Benchmark Metric Change
=================================================
+ lake build no-op branch-misses -12.1% (-16.4 σ)
+ lake build no-op branches -9.3% (-35.4 σ)
+ lake build no-op instructions -7.5% (-28.2 σ)
+ lake configure branch-misses -79.5% (-217.3 σ)
+ lake configure branches -70.7% (-990.4 σ)
+ lake configure instructions -70.9% (-783.7 σ)
+ lake configure maxrss -7.5% (-16.5 σ)
+ lake configure task-clock -52.4% (-34.7 σ)
+ lake configure wall-clock -52.6% (-35σ) |
On Mathlib master, On the toolchain
|
@semorrison
This is surprising. I am not sure why the configuration without the OLean would have gotten significantly faster. Similarly, I am surprised the OLean only gave an ~10% boost. When you ran the test without the OLean, did you run it in fresh repository or did you just delete the |
That was it. Now I get (averaging 10 runs each):
Is the slowdown with |
@semorrison Yes, Lake now just memoizes the import state, not the full environment (because that environment cannot be used by the cached oleans), so there is some expected overhead from recreating it for each dependency. EDIT: I did not feel it was worth it to also cache the environment on top of that because it would would only be useful for |
@semorrison One thing I am curious about from your numbers. How fast is |
|
@semorrison
Wow! That is also a much greater difference between startup and configure times than the speed center benchmark. As such, I would curious in a more fine-grained profile of the Lake's performance in mathlib after merging all these performance improvements. That is, using something like Hotspot (like Sebastian's previous analysis). |
* chore: add release notes for #2470 and #2480 * chore: begin development cycle for 4.2.0 * chore: add Lake-related release notes for v4.1.0 --------- Co-authored-by: Mac Malone <[email protected]>
Local benchmarks indicate that this does not have much effect on simple configurations, but has a major impact on complex ones. For instance, using an prebuilt OLean gave a ~5x configuration speedup for the FFI example on my machine. Essentially, it makes configure time near constant, rather than directly proportional to the complexity of the configuration.
The limiting factor for simple configurations appears to be that the initial import of
Lake
is still expensive.