Skip to content

Use Data.HashMap.lookupKey and Data.HashSet.lookupElement#4802

Merged
fendor merged 1 commit intohaskell:masterfrom
sjakobi:lookupKey
Mar 17, 2026
Merged

Use Data.HashMap.lookupKey and Data.HashSet.lookupElement#4802
fendor merged 1 commit intohaskell:masterfrom
sjakobi:lookupKey

Conversation

@sjakobi
Copy link
Copy Markdown
Member

@sjakobi sjakobi commented Jan 21, 2026

No description provided.

@sjakobi sjakobi changed the title Use Data.HashMap.lookupKey and Data.HashSet.lookup Use Data.HashMap.lookupKey and Data.HashSet.lookupElement Jan 21, 2026
@sjakobi
Copy link
Copy Markdown
Member Author

sjakobi commented Feb 17, 2026

I assume the two failing Windows jobs are due to flaky tests?!

@fendor
Copy link
Copy Markdown
Collaborator

fendor commented Feb 17, 2026

@sjakobi Yes, our tests are unfortunately flaky.

@sjakobi sjakobi added the performance Issues about memory consumption, responsiveness, etc. label Feb 18, 2026
@sjakobi
Copy link
Copy Markdown
Member Author

sjakobi commented Feb 19, 2026

The bench_example (9.10, ubuntu-latest, 3.14, lsp-types) job is all failures for some reason – the success column is all False:

https://github.com/haskell/haskell-language-server/actions/runs/22140687209/job/64005820648?pr=4802#step:7:1

@sjakobi
Copy link
Copy Markdown
Member Author

sjakobi commented Feb 19, 2026

After struggling to get robust results from local runs of the bench/ benchmarks, I've asked Codex to summarize the allocation numbers from the bench_examples CI jobs:

  • cabal / ghc 9.10: overall allocation improved.
  • Mean delta: -7.07% (median -0.21%), from bench-results/pr-4802/run-22140687209/combined/
    results.csv.
  • Biggest wins: code actions -75.25% (17922MB -> 4435MB), completions -33.62%, eval execute
    multi-line code lens -11.14%.
  • Biggest regressions: hover after edit +14.81%, completions after edit +13.66%.
  • cabal / ghc 9.8: roughly flat to slightly better.
  • Mean delta: -0.87% (median +0.91%).
  • Biggest win: completions -23.03%.
  • Biggest regressions: documentSymbols after edit +5.95%, code actions +5.67%.
  • lsp-types / ghc 9.8: overall worse allocation.
  • Mean delta: +7.25% (median +0.90%).
  • Biggest regressions: hover after edit +60.45% (56459MB -> 90586MB), code actions +54.25%
    (14390MB -> 22196MB), edit +16.92%.
  • Biggest win: completions -28.58%.
  • lsp-types / ghc 9.10: all benchmark rows are success=False, so allocation deltas there are
    not reliable for performance conclusions.

Is this a somewhat reliable way to assess HLS performance, @fendor? Otherwise, can you suggest a better way?

@sjakobi sjakobi marked this pull request as ready for review February 19, 2026 14:48
@sjakobi sjakobi requested a review from wz1000 as a code owner February 19, 2026 14:48
@fendor
Copy link
Copy Markdown
Collaborator

fendor commented Feb 20, 2026

@sjakobi Thanks, this looks promising! I'd like to look into this huge regression, this seems 15%, seems like it shouldn't be related.

I imagine the reason is that lsp-types-2.1.1.0 can't be built with GHC 9.10? Requires a --allow-newer=template-haskell on my machine. We probably should bump the versions for the benchmark examples... And spend more time on making sure these benchmarks are run regularly.

@sjakobi sjakobi force-pushed the lookupKey branch 2 times, most recently from b2a5cb7 to ebfe29b Compare February 20, 2026 18:06
Copy link
Copy Markdown
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I am not getting to actually look at the benchmark and I think you have done your due diligence.
Let's merge this to avoid keeping this around forever.

@fendor fendor enabled auto-merge (squash) March 17, 2026 10:11
@fendor fendor merged commit 779890e into haskell:master Mar 17, 2026
40 checks passed
@sjakobi sjakobi deleted the lookupKey branch March 18, 2026 08:40
@sjakobi
Copy link
Copy Markdown
Member Author

sjakobi commented Mar 18, 2026

Thanks @fendor! I'll take another stab at trying to get reliable performance numbers when I get back to haskell/lsp#629.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Issues about memory consumption, responsiveness, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants