Skip to content

Remove unnecessary finalizers#483

Merged
Sergio0694 merged 1 commit intomainfrom
dev/no-finalizers
Oct 27, 2022
Merged

Remove unnecessary finalizers#483
Sergio0694 merged 1 commit intomainfrom
dev/no-finalizers

Conversation

@Sergio0694
Copy link
Copy Markdown
Member

This PR removes two unnecessary finalizers, one in ArrayPoolBufferWriter<T> and one in MemoryOwner<T>. Doing so makes allocating these two types much faster. The finalizers are not needed because the types are wrapping managed resources, and not returning an array to the pool is not critical, plus if a developer forgot to call Dispose that's just a user error and not something that would be done in a "high performance" scenario in the first place.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • Tested code with current supported SDKs
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

@Sergio0694 Sergio0694 added next preview ✈️ This changes will be available in the upcoming preview optimization ☄ Performance or memory usage improvements high-performance 🚂 Issues/PRs for the HighPerformance package labels Oct 26, 2022
@Sergio0694 Sergio0694 merged commit 9faa7fe into main Oct 27, 2022
@delete-merged-branch delete-merged-branch bot deleted the dev/no-finalizers branch October 27, 2022 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

high-performance 🚂 Issues/PRs for the HighPerformance package next preview ✈️ This changes will be available in the upcoming preview optimization ☄ Performance or memory usage improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant