Skip to content

perf: discard oversized query bookkeeping tables - #1236

Open
MichaReiser wants to merge 1 commit into
salsa-rs:masterfrom
MichaReiser:fix/discard-sparse-query-capacity
Open

perf: discard oversized query bookkeeping tables#1236
MichaReiser wants to merge 1 commit into
salsa-rs:masterfrom
MichaReiser:fix/discard-sparse-query-capacity

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

IndexMap clears retained hash control bytes in O(capacity), making sparse query (like 2 edges) frames expensive after a large query.

Ideally, this would be something that HashTable handles better. For now, we'll drop the allocation if we've seen one overly large IndexMap that is only very sparsely populated. Specifically, we preserve up to 2x slack above a 16K floor.

Testing: ty shows a 0.77% static-frame improvement.

@netlify

netlify Bot commented Jul 6, 2026

Copy link
Copy Markdown

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 0dcc897
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/6a6de86cb9d26000084996e9

@MichaReiser MichaReiser changed the title fix: discard oversized query bookkeeping tables perf: discard oversized query bookkeeping tables Jul 6, 2026
@MichaReiser
MichaReiser marked this pull request as ready for review July 6, 2026 17:12
@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 40.03%

⚡ 1 improved benchmark
✅ 73 untouched benchmarks
⏩ 1 skipped benchmark1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime parallel_fast_path[NoEviction] 507.9 µs 362.7 µs +40.03%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing MichaReiser:fix/discard-sparse-query-capacity (0dcc897) with master (59ab5b0)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@MichaReiser
MichaReiser force-pushed the fix/discard-sparse-query-capacity branch from 258b321 to ad26bd3 Compare July 9, 2026 19:45
@MichaReiser
MichaReiser requested a review from ibraheemdev August 1, 2026 12:29
@MichaReiser
MichaReiser force-pushed the fix/discard-sparse-query-capacity branch from ad26bd3 to 0dcc897 Compare August 1, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant