Skip to content

Optimize IDisposable implementations #153

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
Oct 20, 2023

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Oct 19, 2023

  • Make frequently invoked methods OpenSystemLogicOnlyRegion(), EnableSystemOperationRegistration(), DisableSystemOperationRegistration() alloc-less (there were 2 allocations: for Disposable<> & closure)
  • Optimize RegisterRoot()
  • Use static EmptyDisposable where possible
  • Refactor if (!hashSet.Contains(x)) hashSet.Add(x); pattern into hashSet.Add(x) to avoid double search
  • Fix PrefetchManagerBasicTest: prohibit JIT to inline the function

@SergeiPavlov SergeiPavlov requested a review from botinko October 19, 2023 06:09
@SergeiPavlov SergeiPavlov merged commit bf852e6 into master-servicetitan Oct 20, 2023
@SergeiPavlov SergeiPavlov deleted the OpenSystemLogicOnlyRegion branch October 20, 2023 02:52
SergeiPavlov added a commit that referenced this pull request Oct 20, 2023
* Optimize IDisposable implementations

* optimize new List<>(1)

* Optimize EnableSystemOperationRegistration()

* Fix Race condition in tests

* Fix Race condition in tests

* Add [MethodImpl(MethodImplOptions.NoInlining)]
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