Skip to content

feat(server): aligned buffer memory pool#2921

Open
tungtose wants to merge 10 commits intoapache:masterfrom
tungtose:aligned-buffer-memory-pool
Open

feat(server): aligned buffer memory pool#2921
tungtose wants to merge 10 commits intoapache:masterfrom
tungtose:aligned-buffer-memory-pool

Conversation

@tungtose
Copy link
Contributor

@tungtose tungtose commented Mar 12, 2026

pooled_buffer

Prepare the memory pool and buffer infrastructure for O_DIRECT I/O. Direct I/O requires buffers to be aligned to the underlying block size (commonly 4096 bytes). This allows the kernel to bypass the page cache, reducing double buffering and giving more predictable I/O latency.

Known Trade-offs:

  • Minimum allocation size is now 4096 bytes, meaning small utility buffers (e.g. put_u32_le, put_u64_le) now consume more memory than before
  • make_mutable in the HTTP path now copies buffers due to alignment incompatibility with Bytes

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.26%. Comparing base (3f651e0) to head (a0649cc).

Files with missing lines Patch % Lines
core/common/src/alloc/buffer.rs 26.66% 33 Missing ⚠️
core/common/src/alloc/memory_pool.rs 50.00% 13 Missing and 2 partials ⚠️
...ore/common/src/types/message/messages_batch_mut.rs 0.00% 1 Missing ⚠️
...e/common/src/types/segment_storage/index_reader.rs 90.00% 0 Missing and 1 partial ⚠️
...ommon/src/types/segment_storage/messages_reader.rs 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2921      +/-   ##
============================================
- Coverage     70.27%   70.26%   -0.01%     
  Complexity      862      862              
============================================
  Files          1028     1028              
  Lines         85279    85302      +23     
  Branches      62656    62689      +33     
============================================
+ Hits          59932    59940       +8     
- Misses        22833    22838       +5     
- Partials       2514     2524      +10     
Flag Coverage Δ
csharp 67.43% <ø> (-0.19%) ⬇️
go 36.37% <ø> (ø)
java 59.87% <ø> (ø)
node 91.37% <ø> (-0.15%) ⬇️
python 81.43% <ø> (ø)
rust 70.64% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../binary/handlers/messages/send_messages_handler.rs 100.00% <ø> (ø)
core/server/src/http/messages.rs 85.00% <100.00%> (+0.38%) ⬆️
...ore/common/src/types/message/messages_batch_mut.rs 48.04% <0.00%> (+0.29%) ⬆️
...e/common/src/types/segment_storage/index_reader.rs 72.81% <90.00%> (-0.43%) ⬇️
...ommon/src/types/segment_storage/messages_reader.rs 81.94% <90.00%> (+4.72%) ⬆️
core/common/src/alloc/memory_pool.rs 69.12% <50.00%> (-1.18%) ⬇️
core/common/src/alloc/buffer.rs 66.29% <26.66%> (-12.49%) ⬇️

... and 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tungtose tungtose force-pushed the aligned-buffer-memory-pool branch from d83f2f6 to f55e808 Compare March 13, 2026 14:50
@tungtose tungtose force-pushed the aligned-buffer-memory-pool branch from 260a3c2 to cd3560e Compare March 13, 2026 15:23
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