Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: benchmark workspace symbols search
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Lean | ||
open Lean Elab | ||
|
||
def bench (pattern : String) : TermElabM Unit := do | ||
let env ← getEnv | ||
let mut n := 0 | ||
IO.println s!"{env.constants.size} decls" | ||
for (c, _) in env.constants.toList do | ||
if Lean.FuzzyMatching.fuzzyMatch pattern c.toString then n := n + 1 | ||
IO.println s!"{n} matches" | ||
|
||
set_option profiler true | ||
#eval bench "L" | ||
#eval bench "Lean." | ||
#eval bench "Lean.Expr" | ||
#eval bench "Lean.Expr.const" |