Skip to content

feat: re-enable precompileModules - #971

Open
Vtec234 wants to merge 4 commits into
mainfrom
precomp
Open

feat: re-enable precompileModules#971
Vtec234 wants to merge 4 commits into
mainfrom
precomp

Conversation

@Vtec234

@Vtec234 Vtec234 commented Aug 21, 2026

Copy link
Copy Markdown
Member

This PR re-enables precompileModules and documents how this can be leveraged to speed up rebuilds as a tip.

No-Changelog: internal optimization detail.

We do not change Verso's benchmarking configuration at this time - it will continue to measure build times for the default setup (with native-compiled Main executables), as experienced by most users (though leanprover/verso-blueprint's vbp build CLI should immediately benefit from this).

Benchmark results with interpreted Main and precompileModules:

  • Cold build (from scratch to HTML via CLI) times increase or reduce depending on specifics of the project and hardware. They are more likely to increase on highly parallel hardware since the build graph is now more serial (and the critical path longer). They are more likely to reduce when many modules (e.g. Mathlib) are imported by Main since we don't compile these when interpreting Main.
  • Rebuild (from editing the doc to HTML via CLI) and LSP re-elaboration (from editing the doc interactively to LSP server quiescence) reduce by 10–30%.

Raw radar data:

@Vtec234 Vtec234 changed the title feat: re feat: re-enable precompileModules Aug 21, 2026
Comment thread doc/UsersGuide/Elab.lean Outdated
Comment thread doc/UsersGuide/Serve.lean
Comment thread lakefile.lean
@david-christiansen

Copy link
Copy Markdown
Collaborator

Looks basically good modulo docs nitpicks.

Also, because the PR description becomes the commit message, it would be nice to summarize the benchmark runs in the text, because they will presumably not be accessible at that URL in the time period where understanding this commit message might be useful.

Co-authored-by: David Thrane Christiansen <david@lean-fro.org>
@Vtec234

Vtec234 commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

One remaining concern from the sf-in-lean thread: merging this will break Verso on Linux with Lean below v4.34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants