Skip to content

Optimize PackedFieldDescriptor to avoid Bit operations; DO_MAX_1000_COLUMNS definition #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 30, 2024

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Mar 29, 2024

  • Remove PackedFieldDescriptorExtensions

short and byte fields are faster than Shift + AND bit operations

These bit operations are still used at Recordset's fields mapping time, which invoked less frequently than field access operations.

ushort Index field is enough for ~30K fields in recordset because longest Value-types (Guid, DateTimeOffset, decimal) eat 2 longs

Also:

  • Remove [NonSerialized] on AccessorIndex field. It was a rudimentary from time when Accessor field was reference-typed

  • Add DO_MAX_1000_COLUMNS compilation constant to pack PackedFieldDescriptorExtensions into 4 bytes instead of 8. Arrays of this struct consume significant memory. I see:
    51,630 4,911,832 Xtensive.Tuples.Packed.PackedFieldDescriptor[] in the last dump

In this mode max # of recordset columns is ~1000

@SergeiPavlov SergeiPavlov changed the title Optimize PackedFieldDescriptor to avoid Bit operations Optimize PackedFieldDescriptor to avoid Bit operations, DO_MAX_1000_COLUMNS definition Mar 29, 2024
@SergeiPavlov SergeiPavlov changed the title Optimize PackedFieldDescriptor to avoid Bit operations, DO_MAX_1000_COLUMNS definition Optimize PackedFieldDescriptor to avoid Bit operations; DO_MAX_1000_COLUMNS definition Mar 29, 2024
@SergeiPavlov SergeiPavlov merged commit 0f58a0d into master-servicetitan Mar 30, 2024
2 checks passed
@SergeiPavlov SergeiPavlov deleted the bitOperations branch March 30, 2024 11:26
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