Skip to content

Naive POC: recycle buffers used for chunk cache #5037

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

Conversation

timothycoleman
Copy link
Contributor

@timothycoleman timothycoleman commented May 2, 2025

Added: experiment

@timothycoleman timothycoleman requested a review from Copilot May 2, 2025 14:09
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a naive proof-of-concept to recycle buffers for chunk caching in the transaction log.

  • Updates to TFChunkManager and TFChunk to use fixed-size buffer allocation via a new IChunkCacheManager.
  • Introduces two cache manager implementations (UnmanagedChunkCacheManager and PoolingChunkCacheManager) and adds corresponding XUnit tests.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/EventStore.Core/TransactionLog/Chunks/TFChunkManager.cs Updated caching process comments and logic for fixed-size buffers.
src/EventStore.Core/TransactionLog/Chunks/TFChunk.cs Replaced direct memory allocation/free calls with _cacheManager calls.
src/EventStore.Core/TransactionLog/Chunks/ChunkCacheManager.cs Added new cache manager implementations using modern C# initialization patterns.
src/EventStore.Core.XUnit.Tests/TransactionLog/Chunks/PoolingChunkCacheManagerTests.cs Added tests to verify allocation and reuse behaviour in pooling manager.

@timothycoleman timothycoleman force-pushed the timothycoleman/pool-chunk-cache-buffers branch from c8aec04 to d9121d5 Compare May 2, 2025 14:40
@timothycoleman timothycoleman force-pushed the timothycoleman/pool-chunk-cache-buffers branch 2 times, most recently from 801da12 to fe7aa64 Compare May 3, 2025 07:54
@timothycoleman timothycoleman force-pushed the timothycoleman/pool-chunk-cache-buffers branch from fe7aa64 to 1c2f810 Compare May 3, 2025 08:26
@timothycoleman
Copy link
Contributor Author

No need for this, the problem we encountered wasn't related to chunk allocations / fragmentation but windows Commit limit being exceeded

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