Skip to content
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

DocumentVersionCache should use circular (or ring) buffers #9811

Closed
DustinCampbell opened this issue Jan 11, 2024 · 1 comment
Closed

DocumentVersionCache should use circular (or ring) buffers #9811

DustinCampbell opened this issue Jan 11, 2024 · 1 comment

Comments

@DustinCampbell
Copy link
Member

DocumentVersionCache caps the number of IDocumentSnapshot versions that are tracked for a particular document file path at 20. There are a couple of improvements that can be made to this part of the implementation:

  1. It holds the IDocumentSnapshot instances in weak references but never makes any attempt to clean out expired references. So, it will continue to store snapshots (up to 20), even if there are expired entries.
  2. The snapshots are stored in a List<T>. Once 20 snapshots have been cached, future snapshots result in RemoveAt(0) being called, which results in an array copy for every future snapshot. This could be alleviated by using a different structure, such as a circular buffer.
@ghost ghost added the untriaged label Jan 11, 2024
@phil-allen-msft phil-allen-msft added this to the 17.10 Planning milestone Jan 24, 2024
@ghost ghost removed the untriaged label Jan 24, 2024
@davidwengier
Copy link
Contributor

The class in question was removed in #10747

@davidwengier davidwengier closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants