Project

General

Profile

Cleanup #25111

mds: use vector to manage Contexts rather than a list

Added by Patrick Donnelly over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
High
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

#2 Updated by Patrick Donnelly over 5 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF