File tree 1 file changed +4
-1
lines changed
tests/BenchmarkDotNet.IntegrationTests
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -82,15 +82,17 @@ public class AccurateSurvived
82
82
public byte [ ] bytes64 ;
83
83
public Task < int > task ;
84
84
85
- [ GlobalSetup ( Targets = new string [ ] { nameof ( EightBytesArrayNoAllocate ) , nameof ( SixtyFourBytesArrayNoAllocate ) } ) ]
85
+ [ GlobalSetup ( Targets = new string [ ] { nameof ( EightBytesArrayNoAllocate ) , nameof ( SixtyFourBytesArrayNoAllocate ) , nameof ( TaskNoAllocate ) } ) ]
86
86
public void SetupNoAllocate ( )
87
87
{
88
88
bytes8 = new byte [ 8 ] ;
89
89
bytes64 = new byte [ 64 ] ;
90
+ task = Task . FromResult ( default ( int ) ) ;
90
91
}
91
92
92
93
[ Benchmark ] public byte [ ] EightBytesArrayNoAllocate ( ) => bytes8 ;
93
94
[ Benchmark ] public byte [ ] SixtyFourBytesArrayNoAllocate ( ) => bytes64 ;
95
+ [ Benchmark ] public Task < int > TaskNoAllocate ( ) => task ;
94
96
95
97
96
98
[ Benchmark ] public void EightBytesArraySurvive ( ) => bytes8 = new byte [ 8 ] ;
@@ -118,6 +120,7 @@ public void MemoryDiagnoserSurvivedIsAccurate(IToolchain toolchain)
118
120
119
121
{ nameof ( AccurateSurvived . EightBytesArrayNoAllocate ) , 0 } ,
120
122
{ nameof ( AccurateSurvived . SixtyFourBytesArrayNoAllocate ) , 0 } ,
123
+ { nameof ( AccurateSurvived . TaskNoAllocate ) , 0 } ,
121
124
122
125
{ nameof ( AccurateSurvived . EightBytesArraySurvive ) , 8 + objectAllocationOverhead + arraySizeOverhead } ,
123
126
{ nameof ( AccurateSurvived . SixtyFourBytesArraySurvive ) , 64 + objectAllocationOverhead + arraySizeOverhead } ,
You can’t perform that action at this time.
0 commit comments