Merge pull request #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)
commit795786f0ac0e5ea82f288dfeb5b673845e1ef075
tree40966913e314482763d53bea035bf1aa0e1adb08
parent4f25a0f321d7d75af994223771c12d461602b6c9
parentafb78b146b5429f11817688c5277875ff5071021
Merge pull request #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.