You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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.