Skip to content

Buffer small transport reads and reuse scratch space for XDR padding. - #72

Merged
MrTeeett merged 1 commit into
mainfrom
4-reduce-small-reads-and-repeated-allocations-in-bgreaderxdr
Dec 3, 2026
Merged

MrTeeett merged 1 commit into
mainfrom
4-reduce-small-reads-and-repeated-allocations-in-bgreaderxdr

Conversation

@MrTeeett

@MrTeeett MrTeeett commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Read ahead up to 8 KiB when BGReader's background worker is stopped. Keep large reads direct. Track partial reads with an offset so buffers return to the pool at full capacity. Deliver any pending read error with the last bytes of its block.

Closes #4

@MrTeeett MrTeeett added this to the v0.9.0 milestone Dec 1, 2026
@MrTeeett
MrTeeett requested a review from P1cheneG December 1, 2026 09:27
@MrTeeett MrTeeett self-assigned this Dec 1, 2026
@MrTeeett MrTeeett added enhancement New feature or request performance Performance improvements labels Dec 1, 2026
@MrTeeett MrTeeett linked an issue Dec 1, 2026 that may be closed by this pull request
@github-code-quality

github-code-quality Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Go

Go / code-coverage/gotest

main be26d11 4-reduce-small-reads... 551d115 +/-
79% 79% 0%
View coverage of the 3 most impacted files.
File main be26d11 4-reduce-small-reads... 551d115 +/-
fbevent/lifecycle.go 80% 78% -2%
fbproto/xdr.go 88% 88% 0%
fbconn/internal...der/bgreader.go 97% 100% +3%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated December 02, 2026 12:54 UTC

Comment thread fbconn/internal/bgreader/bgreader.go Resolved
Read ahead up to 8 KiB when BGReader's background worker is stopped.
Keep large reads direct. Track partial reads with an offset so buffers
return to the pool at full capacity. Deliver any pending read error
with the last bytes of its block.
@MrTeeett
MrTeeett force-pushed the 4-reduce-small-reads-and-repeated-allocations-in-bgreaderxdr branch from 7224274 to 551d115 Compare December 2, 2026 12:38
@MrTeeett
MrTeeett merged commit 9ec1124 into main Dec 3, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request performance Performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce small reads and repeated allocations in BGReader/XDR

3 participants