RFC: option to not load .ilean content in language server

Open
#16,271 2 comments 3 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active

Research direction

Start by tracing how lake serve -- and lean --server load .ilean files into RAM; the issue does not name the relevant files or tests. Determine whether one option can cover both entry points and what server behavior must remain available without auxiliary information. Done means an optional --no-ilean flag prevents loading those files while preserving the described language server functionality.

Written by the indexing model from the issue text.

Description

RFC
Proposal

We propose a new, optional flag --no-ilean to lake serve -- (rsp. lean --server) which tells the server not to load any .ilean files into RAM.

Optionally, lake build could have an option not even generating them, but this is far less important than the loading as disk space is less restricted than RAM usage.

  • User Experience/Beneficiaries: Programmatic interaction with the language server, like e.g. in lean4game, might not provide any features using the auxilary information coming from ilean files and could thus avoid loading them without loss of functionality.
    This would avoid a significant amount of RAM usage, about 30 % according to our measurements on a project using mathlib.

  • Maintainability: hopefully, this would be as simple as disabling a certain piece of code and thus not be adding a significant maintenance overhead.

  • Workaround: we can work around this by manually replacing all .ilean files in the project with empty files, as it seems that lake build does not recreate the content. Alternatively, we can delete all files after each lake build as it seems that the language server can correctly handle missing files already.

  • Further Context: It seems that from v4.37.0 on, there will be a feature to use .mmap.ilean which can be shared between processes. This would likely already reduce the mentioned RAM usage, but completely disabling the feature would still be more efficient.

Community Feedback

(only discussed in private topics and DMs so far)

Impact

Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.

Dominant language
Lean
Stars
10.3k
Forks
1.1k
Avg merge
19h 8m
Merged PRs (30d)
421

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from leanprover/lean4

All issues in leanprover/lean4

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.