Closed jkotalik closed 5 years ago
Better perf numbers.
BenchmarkDotNet=v0.10.13, OS=Windows 10.0.17134
Intel Xeon CPU E5-1650 v4 3.60GHz, 1 CPU, 12 logical cores and 6 physical cores
.NET Core SDK=2.2.100-preview2-009404
[Host] : .NET Core 2.2.0-preview2-26905-02 (CoreCLR 4.6.26905.03, CoreFX 4.6.26905.02), 64bit RyuJIT
Job-MVJLBU : .NET Core 2.2.0-preview2-26905-02 (CoreCLR 4.6.26905.03, CoreFX 4.6.26905.02), 64bit RyuJIT
Runtime=Core Server=True Toolchain=.NET Core 2.2
RunStrategy=Throughput
Method | Mean | Error | StdDev | Op/s | Allocated |
---|---|---|---|---|---|
WriteHelloWorld | 149.7 ns | 2.952 ns | 4.327 ns | 6,679,947.5 | 32 B |
WriteHelloWorldLargeWrite | 60,649.7 ns | 812.198 ns | 759.731 ns | 16,488.1 | 100002 B |
Perf numbers:
Using Memory and MemoryPool:
Method | Mean | Error | StdDev | Op/s | Allocated |
---|---|---|---|---|---|
WriteHelloWorld | 200.1 ns | 3.846 ns | 4.579 ns | 4,998,578.2 | 32 B |
WriteHelloWorldLargeWrite | 61,825.2 ns | 1,081.980 ns | 959.147 ns | 16,174.6 | 100003 B |
Using byte[] and ArrayPool:
Method | Mean | Error | StdDev | Op/s | Allocated |
---|---|---|---|---|---|
WriteHelloWorld | 149.7 ns | 2.952 ns | 4.327 ns | 6,679,947.5 | 32 B |
WriteHelloWorldLargeWrite | 60,649.7 ns | 812.198 ns | 759.731 ns | 16,488.1 | 100002 B |
https://github.com/aspnet/HttpAbstractions/pull/1065#issuecomment-438898235
These numbers don't sit well with me. I don't see how the allocated bytes can be that similar.
What are the latest perf results?
Removed the MemoryStream and made an underlying noop stream instead.
Method | Mean | Error | StdDev | Op/s | Allocated |
---|---|---|---|---|---|
WriteHelloWorld | 179.2 ns | 3.603 ns | 6.404 ns | 5,580,116.0 | 0 B |
WriteHelloWorldLargeWrite | 2,029.8 ns | 40.592 ns | 94.883 ns | 492,654.3 | 0 B |
Half of https://github.com/aspnet/AspNetCore/issues/3966.
Few questions:
Tests
Performance
Current performance numbers: