Skip to content

perf: use String.compare in ConfigEval decision tree - #13806

Draft
kmill wants to merge 1 commit into
masterfrom
kmill_configeval_compare
Draft

perf: use String.compare in ConfigEval decision tree#13806
kmill wants to merge 1 commit into
masterfrom
kmill_configeval_compare

Conversation

@kmill

@kmill kmill commented May 20, 2026

Copy link
Copy Markdown
Collaborator

This PR improves performance of matching configuration items by using String.compare to implement the decision tree for interpreting configuration option names.

#13796 optimized String.compare to do only a single memcmp, which we can take advantage of here.

@kmill kmill added the changelog-no Do not include this PR in the release changelog label May 20, 2026
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label May 20, 2026
@mathlib-lean-pr-testing

mathlib-lean-pr-testing Bot commented May 20, 2026

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase ada1696f040c749e6038e516266c4c1c94eb27e1 --onto 43ef70db63e2c1c1720b84fd153125c96a00c5d2. You can force Mathlib CI using the force-mathlib-ci label. (2026-05-20 17:57:27)
  • ✅ Mathlib branch lean-pr-testing-13806 has successfully built against this PR. (2026-08-29 19:04:19) View Log

@leanprover-bot

leanprover-bot commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase ada1696f040c749e6038e516266c4c1c94eb27e1 --onto 803553a556fd82fa1060efb0c43eda542130cb16. You can force reference manual CI using the force-manual-ci label. (2026-05-20 17:57:29)
  • ✅ Reference manual branch lean-pr-testing-13806 has successfully built against this PR. (2026-08-29 18:14:26) View Log
  • 🟡 Reference manual branch lean-pr-testing-13806 build against this PR didn't complete normally. (2026-08-29 18:15:59) View Log

@kmill

kmill commented May 20, 2026

Copy link
Copy Markdown
Collaborator Author

!bench

@leanprover-radar

leanprover-radar commented May 20, 2026

Copy link
Copy Markdown

Benchmark results for 6a68eea against ada1696 are in. No significant results found. @kmill

  • 🟥 build//instructions: +1.7G (+0.02%)

Small changes (10🟥)

  • 🟥 build/module/Lean.Elab.ConfigEval.MetaInstances//instructions: +79.1M (+3.33%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.ConfigEval.Util//instructions: +131.3M (+3.44%) (reduced significance based on *//lines)
  • 🟥 build/module/Lean.Elab.Tactic.BVDecide.Frontend.Attr//instructions: +73.7M (+2.06%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Do.VCGen.Basic//instructions: +77.2M (+0.85%)
  • 🟥 build/module/Lean.Elab.Tactic.Grind.Config//instructions: +114.8M (+1.33%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Lets//instructions: +53.0M (+1.31%)
  • 🟥 build/module/Lean.Elab.Tactic.LibrarySearch//instructions: +23.8M (+0.64%)
  • 🟥 build/module/Lean.Elab.Tactic.NormCast//instructions: +200.7M (+1.66%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Simp//instructions: +167.9M (+0.87%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.SolveByElim//instructions: +65.7M (+1.45%) (reduced significance based on absolute threshold)

This PR improves performance of matching configuration items by using `String.compare` to implement the decision tree for interpreting configuration option names.
@kmill
kmill force-pushed the kmill_configeval_compare branch from 6a68eea to e604bbb Compare August 29, 2026 17:53
@github-actions github-actions Bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Aug 29, 2026
@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Aug 29, 2026
@kmill

kmill commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

!bench

@leanprover-radar

leanprover-radar commented Aug 29, 2026

Copy link
Copy Markdown

Benchmark results for e604bbb against e991a05 are in. No significant results found. @kmill

  • 🟥 build//instructions: +2.6G (+0.02%)

Small changes (9🟥)

  • 🟥 build/module/Lean.Elab.ConfigEval.MetaInstances//instructions: +98.7M (+3.79%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.ConfigEval.Util//instructions: +141.8M (+3.61%) (reduced significance based on *//lines)
  • 🟥 build/module/Lean.Elab.Tactic.Do.VCGen.Basic//instructions: +81.4M (+0.90%)
  • 🟥 build/module/Lean.Elab.Tactic.Grind.Config//instructions: +142.6M (+1.59%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Lets//instructions: +57.1M (+1.37%)
  • 🟥 build/module/Lean.Elab.Tactic.NormCast//instructions: +249.9M (+2.16%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Simp//instructions: +201.6M (+1.09%)
  • 🟥 build/module/Lean.Elab.Tactic.SolveByElim//instructions: +70.5M (+1.52%)
  • 🟥 build/module/Lean.Meta.Tactic.BVDecide.Attr//instructions: +61.8M (+1.69%)

@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR builds-mathlib CI has verified that Mathlib builds against this PR changelog-no Do not include this PR in the release changelog mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants