Skip to content

Conversation

@Sergio0694
Copy link
Member

@Sergio0694 Sergio0694 commented May 16, 2023

Overview

This PR includes a couple tweaks to ImmutableArrayBuilder<T>:

  • Drops the ObjectPool<T> use, and just uses ArrayPool<T>. This means we can now also benefit from the automatic trimming that ArrayPool<T> implements if there is high GC pressure. Also, we're no longer reinventing the wheel here.
  • Make the type a ref struct, since we're never meant to pass this outside or box it.
  • Add ref scope annotations where needed

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 optimization ☄ Performance or memory usage improvements mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit analyzer 👓 A new analyzer being implemented or updated labels May 16, 2023
@Sergio0694
Copy link
Member Author

Hey @Youssef1313, would you mind taking a quick look when you have a minute? Thank you! 🙂

@Sergio0694 Sergio0694 force-pushed the dev/generator-array-pool branch from 161519c to f87610a Compare May 16, 2023 12:11
Copy link
Contributor

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analyzer 👓 A new analyzer being implemented or updated mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit optimization ☄ Performance or memory usage improvements

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants