leanprover / leanprover/lean4

Parsing long but simple expressions should not take 30s+

Open
#8,039 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Ah, I see I can call lean --profile from https://lean-lang.org/talks/lmu2024.pdf, which gives

% lean --profile test_30_noprofile.lean 
parsing took 28.2s
test_30_noprofile.lean:12:0: warning: declaration uses 'sorry'
elaboration took 252ms
cumulative profiling times:
        attribute application 0.00892ms
        elaboration 254ms
        fix level params 0.0147ms
        import 65.5ms
        initialization 17ms
        instantiate metavars 0.017ms
        interpretation 5.52ms
        linting 11.7ms
        parsing 28.2s
        process pre-definitions 0.174ms
        share common exprs 0.757ms
        tactic execution 0.177ms
        type checking 0.132ms

Originally posted by @JasonGross in #8038

See that issue for the code and more context

Contributor guide

Open the contributing guide

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.

Research direction

Start with issue #8038, which contains the code and context for the long-expression parsing case. Use the reported lean --profile output to confirm that parsing, rather than elaboration, dominates runtime. Done means identifying and resolving the parsing slowdown without regressing the existing behavior.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.