This PR makes aggressive use of object pooling in the StreamingHub to reduce memory and object allocation.
Results
Call StreamingHub method / 10 seconds
dotnet run -c Release --no-build -- -u http://localhost:5000 -s StreamingHubComplex
Before
Allocations
7.34 M objects
853.23 MB
1.22 M reqs = Task<ComplexResponse>
853.23 / 1.22 = 699.36 MB per 1M reqs
7.34 / 1.22 = 6.01 M objs per 1M reqs
After
Allocations
6.71 M objects
587.56 MB
2.22 M reqs = Task<ComplexResponse>
587.56 / 2.22 = 264.66 MB per 1M reqs
6.71 / 2.22 = 3.02 M objs per 1M reqs
Name
Baseline
PR
Ratio
Memory allocation
699.36 MB
264.66 MB
0.37
Objects allocation
6.01 M
3.02 M
0.5
[!NOTE]
At first glance, the rps (requests/sec) values look better in After, but the accuracy of the rps measurement is not guaranteed and is therefore ignored this time.
This PR makes aggressive use of object pooling in the StreamingHub to reduce memory and object allocation.
Results
Call StreamingHub method / 10 seconds
Before
Task<ComplexResponse>
After
Task<ComplexResponse>