Skip to content

perf(drivers): Use smallvec for AvailBufferToken #1728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025

Conversation

Gelbpunkt
Copy link
Member

@Gelbpunkt Gelbpunkt commented May 23, 2025

While it is hypothetically possible to have send and receive buffers of sizes up to that of the virt queue, in reality we only ever have up to 2 items here. smallvec lets us handle this case very efficiently while still theoretically allowing for larger amounts of items.

This should get rid of a lot of the heap allocations in fill_queue.

Improves throughput by about ~20% in my benchmarks.

While it is hypothetically possible to have send and receive buffers
of sizes up to that of the virt queue, in reality we only ever have up
to 2 items here. smallvec lets us handle this case very efficiently
while still theoretically allowing for larger amounts of items.

Signed-off-by: Jens Reidel <[email protected]>
@mkroening mkroening self-assigned this May 25, 2025
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

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

Thanks! :)

@mkroening mkroening added this pull request to the merge queue May 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 26, 2025
@mkroening mkroening added this pull request to the merge queue May 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 26, 2025
@mkroening mkroening added this pull request to the merge queue May 26, 2025
Merged via the queue into hermit-os:main with commit 70dc050 May 26, 2025
13 checks passed
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