Merge pull request dotnet/coreclr#1629 from ericeil/AsyncLocalPerf
authorEric Eilebrecht <ericeil@users.noreply.github.com>
Sat, 26 Sep 2015 17:54:11 +0000 (10:54 -0700)
committerEric Eilebrecht <ericeil@users.noreply.github.com>
Sat, 26 Sep 2015 17:54:11 +0000 (10:54 -0700)
commit6389e9096a9faa1b3666ea82dde8cc1b108cb50c
treec60247d9dcd2f05251fcc6527c5a20db8f393c06
parent3d28f013441ace293e9f4f98283f045261eccdbd
parent44d982fe848876b2534c84eae5e6045ea3a16a64
Merge pull request dotnet/coreclr#1629 from ericeil/AsyncLocalPerf

Reduce allocations in AsyncLocal/ExecutionContext

1: Allocate a new AsyncLocal change notification list only if we need to add an item to the list.
2: Pre-size any collections we allocate, and manually copy into them to avoid IEnumerator allocations, etc.
3: Store the change notification list in an array, rather than a List, to avoid the extra List allocation.

Commit migrated from https://github.com/dotnet/coreclr/commit/795786f0ac0e5ea82f288dfeb5b673845e1ef075