Skip to content

Conversation

@SergeiPavlov
Copy link
Contributor

@SergeiPavlov SergeiPavlov commented Jul 19, 2021

Profiling shows significant heap allocations in these places, which are suboptimal.

  • Optimizations: allocate List<> with known capacity; use IReadOnlyList instead of ReadOnlyList
  • Optimize hot paths: replace LINQ by foreach
  • ReadOnlyList wrapper is unnecessary, because since .NET 45 List<> implements IReadOnlyList

…st instead of ReadOnlyList to save allocations (#32)

* Optimizations: allocate List<> with known capacity; use IReadOnlyList instead of ReadOnlyList

* Optimize hot paths: replace LINQ by foreach
Copy link
Contributor

@alex-kulakov alex-kulakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are mostly OK. Some changes are required though. I have suggested changes to apply where I could. SqlColumnCollection lacks copyright update and that I couldn't suggest

SergeiPavlov and others added 6 commits August 23, 2021 23:49
Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
@SergeiPavlov
Copy link
Contributor Author

The changes are mostly OK. Some changes are required though. I have suggested changes to apply where I could. SqlColumnCollection lacks copyright update and that I couldn't suggest

Changed its copyright line: b930c31

@alex-kulakov alex-kulakov merged commit 27294bb into DataObjects-NET:master Aug 24, 2021
@SergeiPavlov SergeiPavlov deleted the optimizeAllocations branch December 6, 2021 19:06
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