Skip to content

Comments

memorypool: optimize rc a little more#48306

Merged
jkarneges merged 1 commit intomainfrom
jkarneges/rc-optimize
Feb 12, 2026
Merged

memorypool: optimize rc a little more#48306
jkarneges merged 1 commit intomainfrom
jkarneges/rc-optimize

Conversation

@jkarneges
Copy link
Member

@jkarneges jkarneges commented Feb 11, 2026

At some point during the recent memorypool refactoring I added the slab key to the RcInner struct in order to speed up drop. This caused a regression in the benchmarks, likely due to the increased struct size resulting in less CPU caching. Reverting it restores the expected performance.

Doing it this way requires the key_of method from the slab crate, which I've copied into to our fork. I should note that a new version of the slab crate was published which has our element removal performance fix, so we can probably discard our fork and switch back to the crate now, but I'll do that in a separate PR.

@jkarneges jkarneges requested a review from a team February 12, 2026 18:41
@jkarneges jkarneges merged commit 2777153 into main Feb 12, 2026
19 checks passed
@jkarneges jkarneges deleted the jkarneges/rc-optimize branch February 12, 2026 20:53
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.

2 participants