-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from dbolin/nullablePerf
improve performance of nullables
- Loading branch information
Showing
7 changed files
with
161 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
#nullable disable | ||
|
||
namespace Benchmark | ||
{ | ||
public class PerformanceSuite_NullableInts : PerformanceSuiteBase | ||
{ | ||
private readonly List<int?> _listInt = new List<int?>(Enumerable.Range(0, 1024).Select(x => (int?)x)); | ||
|
||
public PerformanceSuite_NullableInts() | ||
{ | ||
_listInt.Capacity = 1024; | ||
S_NullableInts(); | ||
} | ||
|
||
[Benchmark] | ||
public void S_NullableInts() | ||
{ | ||
Serialize(_listInt); | ||
} | ||
|
||
[Benchmark] | ||
public object D_NullableInts() | ||
{ | ||
return Deserialize<List<int?>>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters