Skip to content

perf: skip full size scan for an empty HTTP cache - #2597

Draft
Aryan Singh K. (aryansk) wants to merge 1 commit into
microsoft:mainfrom
aryansk:perf/2555-empty-http-cache-fast-path
Draft

perf: skip full size scan for an empty HTTP cache#2597
Aryan Singh K. (aryansk) wants to merge 1 commit into
microsoft:mainfrom
aryansk:perf/2555-empty-http-cache-fast-path

Conversation

@aryansk

Copy link
Copy Markdown
Contributor

Summary

Initialize the HTTP cache's tracked size to zero when the cache directory is empty, detected with a single directory-entry probe. Existing non-empty caches keep the current None sentinel and still receive a real size scan before the fast path can skip eviction work.

Validation

Preserves size-cap correctness for existing caches while avoiding an unnecessary full scandir on the first store into a new or empty cache.

Addresses #2555.

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