Skip to content

feat: improve workspace symbol performance - #8091

Merged
mhuisi merged 2 commits into
leanprover:masterfrom
mhuisi:mhuisi/workspace-symbol-performance
May 13, 2025
Merged

mhuisi merged 2 commits into
leanprover:masterfrom
mhuisi:mhuisi/workspace-symbol-performance

Conversation

@mhuisi

@mhuisi mhuisi commented Apr 24, 2025 •

Copy link
Copy Markdown
Contributor

This PR improves the performance of the workspace symbol request.

In my testing on my machine, the time to respond to the workspace symbol request containing just c in Mathlib has been reduced to ~1200ms from ~11000ms.

We also serve the nearest-matching 1000 symbols instead of just the first 100 now and use the length of the symbol as a tie-breaker for when the fuzzy matching score is equal.

Some further improvements might be gained in the future when #8087 is fixed and we can switch back to qsort.

@mhuisi mhuisi added the changelog-server Language server, widgets, and IDE extensions label Apr 24, 2025
@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 Apr 24, 2025
@ghost

ghost commented Apr 24, 2025 •

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 c8cdb57c4b66bbcc0bf2d42176e1e7de33131c1d --onto 02f7a1dd41f034939acf49a5c2c590076cb26d8e. You can force Mathlib CI using the force-mathlib-ci label. (2025-04-24 15:28:01)
  • ✅ Mathlib branch lean-pr-testing-8091 has successfully built against this PR. (2025-04-28 16:32:06) View Log

@mhuisi
mhuisi force-pushed the mhuisi/workspace-symbol-performance branch from e3ffd6c to df7e874 Compare April 28, 2025 15:17
@mhuisi
mhuisi marked this pull request as ready for review April 28, 2025 15:29
@mhuisi

mhuisi commented Apr 28, 2025

Copy link
Copy Markdown
Contributor Author

!bench

ghost pushed a commit to leanprover-community/batteries that referenced this pull request Apr 28, 2025
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 28, 2025
@leanprover-bot

Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit df7e874.
There were significant changes against commit 747ea85:

  Benchmark                            Metric          Change
  =====================================================================
+ Init.Data.List.Sublist re-elab -j4   branch-misses    -1.8% (-14.2 σ)
+ Std.Data.Internal.List.Associative   branch-misses    -1.2% (-15.0 σ)
+ bv_decide_inequality.lean            task-clock       -4.1% (-15.0 σ)
- ilean roundtrip                      parse             3.9%  (12.2 σ)

@ghost ghost added the builds-mathlib CI has verified that Mathlib builds against this PR label Apr 28, 2025
@mhuisi
mhuisi added this pull request to the merge queue May 13, 2025
Merged via the queue into leanprover:master with commit efcf942 May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-server Language server, widgets, and IDE extensions 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.

2 participants