Skip to content

Conversation

@flaneur2020
Copy link
Contributor

@flaneur2020 flaneur2020 commented Jan 30, 2026

Which issue does this PR close?

Closes #6372

Rationale for this change

the current FoyerLayer caches entire objects, which is inefficient for large files with partial/range reads. this PR adds chunked caching mode to improve cache efficiency for large objects by caching fixed-size chunks independently.

What changes are included in this PR?

  1. this pr adds a chunked caching mode: when with_chunk_size() is set, the caching scheme changes to chunked mode. the caching processing logics in deleter/writer are disabled in the chunked mode, we can consider to add them later in another pr.
  2. refactor FoyerKey and FoyerValue to enums: with chunked caching enabled, besides the chunked data, we also require to cache the metadata about each object.

Are there any user-facing changes?

yes, new API added FoyerLayer::with_chunk_size(chunk_size: usize) to enable chunked caching mode

AI Usage Statement

this PR was developed with assistance from opus4.5, with review by myself.

suggestions for review: The main changes are located in the newly added chunked.rs file, while the other modifications are mostly tests in lib.rs.

@flaneur2020 flaneur2020 marked this pull request as ready for review January 30, 2026 14:25
@flaneur2020 flaneur2020 requested a review from Xuanwo as a code owner January 30, 2026 14:25
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking issues for RFC-6370: Foyer Layer

1 participant