Performance Profiling

Open
#136 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale

Research direction

Start by reproducing the local build timings for the listed Cslib modules, then inspect Cslib.Languages.LambdaCalculus.LocallyNameless and its grind rules for typing contexts. Compare the slower modules with longer-file cases and determine whether a specific cause or actionable improvement can be identified; the issue does not define a completion target.

Written by the indexing model from the issue text.

Description

Maybe this should be a running meta-issue. I've noticed that some of the lambda calculus modules are slow, so I decided to look at build times. Here are the 15 slowest (of ~50) from me building locally, which happens to coincide with a cutoff of 5 seconds:

Cslib.Languages.LambdaCalculus.LocallyNameless.Fsub.Subtype (11s)
Cslib.Logics.LinearLogic.CLL.Basic (10s)
Cslib.Foundations.Data.FinFun (10s)
Cslib.Languages.LambdaCalculus.LocallyNameless.Stlc.Basic (9.1s)
Cslib.Languages.LambdaCalculus.LocallyNameless.Fsub.WellFormed (8.8s)
Cslib.Languages.LambdaCalculus.LocallyNameless.Fsub.Typing (8.5s)
Cslib.Logics.LinearLogic.CLL.PhaseSemantics.Basic (8.4s)
Cslib.Languages.LambdaCalculus.LocallyNameless.Fsub.Opening (8.3s)
Cslib.Foundations.Data.OmegaSequence.Init (8.0s)
Cslib.Foundations.Lint.Basic (7.2s)
Cslib.Foundations.Semantics.LTS.Bisimulation (6.8s)
Cslib.Foundations.Data.OmegaSequence.Flatten (6.0s)
Cslib.Languages.LambdaCalculus.LocallyNameless.Fsub.Safety (5.7s)
Cslib.Languages.CCS.BehaviouralTheory (5.7s)
Cslib.Languages.LambdaCalculus.LocallyNameless.Untyped.FullBetaConfluence (5.2s)

I have a guess at some issues in Cslib.Languages.LambdaCalculus.LocallyNameless related to grind rules for typing contexts. Some others may just be longer files, there is not necessarily something wrong in all cases.

Dominant language
Lean
Stars
862
Forks
242
Avg merge
1d 4h
Merged PRs (30d)
55

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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/cslib

All issues in leanprover/cslib

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.