Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamline rent/return on ArrayPool (#55710)
* 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 * Address PR feedback
- Loading branch information