Skip to content
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

Streamline rent/return on ArrayPool #55710

Merged
merged 2 commits into from
Jul 16, 2021
Merged

Commits on Jul 15, 2021

  1. Streamline rent/return on ArrayPool

    - Stop storing and using a _bucketArraySizes.  It's cheaper to recompute the shift on each use than it is to index into the array (with a bounds check).  Plus less memory.
    - The 99% case is renting a positive length for pooled array sizes (especially now that we've bumped the limit up to a gig).  Move the checks for lengths <= 0 to after the check for whether the length is poolable.
    - Move arrays into locals to enable the JIT to eliminate some bounds checks.
    - Use ThrowHelpers where we already have them
    - Move non-generic helpers out of generic class into Utilities
    - Consolidate buffer allocation in Rent to a single line
    - Reorganize TLS checks to be as early as possible
    - Use FastMod instead of % in per-core stacks
    stephentoub committed Jul 15, 2021
    Configuration menu
    Copy the full SHA
    91350e3 View commit details
    Browse the repository at this point in the history
  2. Address PR feedback

    stephentoub committed Jul 15, 2021
    Configuration menu
    Copy the full SHA
    23d2b73 View commit details
    Browse the repository at this point in the history