Skip to content

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Feb 6, 2025

According a Dump we have 182,304 instances of this type in memory.
class type overhead over struct is 24 bytes.
Converting it into readonly struct will save >4MB

Also:

  • Introduced a new property ColumnCollection.Columns as a replacement of removed inheriting of IReadOnlyList<Column>

@botinko
Copy link

botinko commented Feb 6, 2025

@SergeiPavlov just curious, if you checked, that ColumnCollection is not heavely boxed. I this case it can increase allocation rate and make optimization less effective or even make it worse.

@SergeiPavlov
Copy link
Collaborator Author

SergeiPavlov commented Feb 6, 2025

if you checked, that ColumnCollection is not heavely boxed.

DO never does boxing for such kind of types.
ColumnCollection is a field of RecordSetHeader class and number of instances of these types are almost the same.
That means RecordSetHeader is the main owner of this type

@SergeiPavlov SergeiPavlov merged commit e4c5d27 into master-servicetitan Feb 6, 2025
4 checks passed
@SergeiPavlov SergeiPavlov deleted the ColumnCollection branch February 6, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants