Skip to content

Make Buffer track per-block (not per-byte) ownership#1091

Closed
mkeeter wants to merge 6 commits intooxidecomputer:mainfrom
mkeeter:per-block-ownership
Closed

Make Buffer track per-block (not per-byte) ownership#1091
mkeeter wants to merge 6 commits intooxidecomputer:mainfrom
mkeeter:per-block-ownership

Conversation

@mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Jan 9, 2024

This reduces storage (and operations) in the struct Buffer by the block size, so a factor of 512× or 4096×.

The downside is that we need to know the block size at construction time, so there's a bunch of mechanical changes in this PR.

I see significant speedups for all sizes of random reads except 4K, which become slightly slower (50.6 MiB/s → 46.9 MiB/s, not sure why).

Screenshot 2024-01-09 at 3 01 13 PM

@mkeeter mkeeter requested review from jmpesp, leftwo and pfmooney January 9, 2024 20:05
@mkeeter
Copy link
Contributor Author

mkeeter commented Jan 9, 2024

Re-running on Crucible main (099c201), I see 44.5 MiB/s, so I suspect the 50.6 MiB/s reading was a fluke. This means that there's no performance regression, so we can move forward with the PR.

@mkeeter
Copy link
Contributor Author

mkeeter commented Jan 10, 2024

(let's put this on hold until #1094, which touches a bunch of similar code)

@mkeeter
Copy link
Contributor Author

mkeeter commented Jan 23, 2024

Closing in favor of #1105, since this has diverged from main and I want to split into two bite-sized PRs.

@mkeeter mkeeter closed this Jan 23, 2024
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