Project

General

Profile

Cleanup #25111

mds: use vector to manage Contexts rather than a list

Added by Patrick Donnelly 5 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
High
Category:
Performance/Resource Usage
Target version:
Start date:
07/25/2018
Due date:
% 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 5 months ago

  • Status changed from Need Review to Resolved

Also available in: Atom PDF