Skip to content

Optimizations of Domain build #83

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 6 commits into from
Aug 23, 2022
Merged

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Aug 20, 2022

  • Wrap internal collections into ReadOnlyCollection only if DO_SAFE_COLLECTION_WRAPPER is defined (default Upstream DataObjects policy is "always wrap public available lists and array"). In our build we need not to define DO_SAFE_COLLECTION_WRAPPER. Use new .AsSafeWrapper() instead of .AsReadOnly() where possible

  • Avoid unnecessary .ToList() in TopologicalSorter.Sort()

  • Create FieldInfo.Associations collection on demaind. Most fields don't have associations

  • Optimize TypeInfo.Validators lists

  • readonly struct ColumnIndexMap

@SergeiPavlov SergeiPavlov requested a review from botinko August 20, 2022 05:36
@botinko
Copy link

botinko commented Aug 21, 2022

What is the difference between DO_SAFE_COLLECTION_WRAPPER on and off in terms of performace? what is the approximate difference?

@SergeiPavlov
Copy link
Collaborator Author

SergeiPavlov commented Aug 22, 2022

What is the difference between DO_SAFE_COLLECTION_WRAPPER on and off in terms of performace? what is the approximate difference?

The main price is additional memory footprint ( a few MBs):
image

@SergeiPavlov SergeiPavlov merged commit 3541093 into master-servicetitan Aug 23, 2022
SergeiPavlov added a commit that referenced this pull request Sep 6, 2022
* Optimize TypeInfo.Validators

* Optimization: create FieldInfo.Assocations on demand

* Avoid unnecessary .ToList() in TopologicalSorter.Sort()

* DO_SAFE_COLLECTION_WRAPPER constant

* readonly struct ColumnIndexMap

* Optimize IReadOnlyList in SelectProvider
@SergeiPavlov SergeiPavlov deleted the Optimize_TypeInfo branch March 10, 2023 22:41
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