Cleanup #25111
mds: use vector to manage Contexts rather than a list
Status:
Resolved
Priority:
High
Assignee:
Category:
Performance/Resource Usage
Target version:
% Done:
0%
Tags:
Backport:
Reviewed:
Affected Versions:
Component(FS):
MDS
Labels (FS):
task(medium)
Pull request ID:
Description
This is all about the usual benefits of converting a list to a vector without any of the potential drawbacks:
- We don't need a memory allocation for each Context * with all accompanying overhead.
- Access is contiguous and cache-friendly.
- Clearing a vector is a single free internally; no destructors need be called.
Splicing is theoretically more expensive but due to the cache friendliness of vectors, this is likely to be negligible.
History
#1 Updated by Patrick Donnelly over 5 years ago
#2 Updated by Patrick Donnelly over 5 years ago
- Status changed from Fix Under Review to Resolved