-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Reflection Performance Benchmarks
- Loading branch information
1 parent
c5efd9f
commit 47e7b73
Showing
2 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using BenchmarkComponent; | ||
using BenchmarkDotNet.Attributes; | ||
|
||
namespace Benchmarks | ||
{ | ||
[MemoryDiagnoser] | ||
public class ReflectionPerf | ||
{ | ||
ClassWithMarshalingRoutines instance; | ||
|
||
[GlobalSetup] | ||
public void Setup() | ||
{ | ||
instance = new ClassWithMarshalingRoutines(); | ||
} | ||
|
||
[Benchmark] | ||
public void ExecuteComWrappersCreateKeyValuePairsFactory() | ||
{ | ||
var value = instance.DefaultKeyValuePairProperty; | ||
} | ||
|
||
[Benchmark] | ||
public void ExecuteComWrappersCreateArrayFactory() | ||
{ | ||
var value = instance.DefaultArrayProperty; | ||
} | ||
|
||
[Benchmark] | ||
public void ExecuteComWrappersCreateNullableFactory() | ||
{ | ||
var value = instance.DefaultNullableProperty; | ||
} | ||
} | ||
} |