Skip to content

perf: allow concurrent TrackConsumersPool updates - #24993

Open
yashrb24 wants to merge 1 commit into
apache:mainfrom
yashrb24:perf/track-consumers-rwlock
Open

perf: allow concurrent TrackConsumersPool updates#24993
yashrb24 wants to merge 1 commit into
apache:mainfrom
yashrb24:perf/track-consumers-rwlock

Conversation

@yashrb24

@yashrb24 yashrb24 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #24994

Why is this change needed?

TrackConsumersPool used one exclusive lock for every memory update. This made unrelated threads wait for each other when growing or releasing memory.

What changed?

  • Replaced the exclusive mutex with a read/write lock.
  • grow, shrink, and try_grow can now read the consumer map at the same time.
  • Registration, removal, and reporting remain exclusive.
  • Fixed peak-memory tracking when memory is updated concurrently.

There are no public API changes.

How was this tested?

  • Existing datafusion-execution memory-pool tests pass.

Performance

todo: some before/after results from a parallel memory-reservation benchmark

@github-actions github-actions Bot added the execution Related to the execution crate label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

execution Related to the execution crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TrackConsumersPool makes memory updates wait on one shared lock

1 participant