Reduce memory allocation in Http2Stream (dotnet/corefx#35179)
authorStephen Toub <stoub@microsoft.com>
Sun, 10 Feb 2019 00:32:15 +0000 (19:32 -0500)
committerGitHub <noreply@github.com>
Sun, 10 Feb 2019 00:32:15 +0000 (19:32 -0500)
commite8314907d2a49f8575ff94b7e81c9666795bae56
treeecb958f4eba469f3b3df097ed490bfb21d6b5934
parentfe1157edf254076052379da0660967486433c6c5
Reduce memory allocation in Http2Stream (dotnet/corefx#35179)

* Reduce memory allocation in Http2Stream

- Pool response buffers via ArrayPool
- Don't allocate a separate sync object
- Shrink the size of a few types

* Address PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/24aa561da2d0632dc284bc230b1147ace848d22b
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ArrayBuffer.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionResponseContent.cs