-
Notifications
You must be signed in to change notification settings - Fork 107
/
GuidPerf.cs
81 lines (69 loc) · 2.55 KB
/
GuidPerf.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using BenchmarkComponent;
using BenchmarkDotNet.Attributes;
using System;
using System.Reflection;
#if !NETCOREAPP3_1
using WinRT;
namespace Benchmarks
{
[MemoryDiagnoser]
public class GuidPerf
{
[Benchmark]
public object GetClassGuid()
{
return WinRT.GuidGenerator.GetIID(typeof(ClassWithMarshalingRoutines));
}
[Benchmark]
public object GetDelegateGuid()
{
return WinRT.GuidGenerator.GetIID(typeof(Windows.Foundation.AsyncActionCompletedHandler));
}
[Benchmark]
public object CreateListGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IList<ClassWithMarshalingRoutines>));
}
[Benchmark]
public object CreateDictionaryWithStringKeyGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IDictionary<String, ClassWithMarshalingRoutines>));
}
[Benchmark]
public object CreateDictionaryWithBoolKeyGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IDictionary<bool, ClassWithMarshalingRoutines>));
}
[Benchmark]
public object CreateReadOnlyEnumListGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IReadOnlyList<Windows.Foundation.AsyncStatus>));
}
[Benchmark]
public object CreateReadOnlyFlagEnumListGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IReadOnlyList<Windows.Storage.FileAttributes>));
}
[Benchmark]
public object CreateReadOnlyStructListGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IReadOnlyList<NonBlittable>));
}
[Benchmark]
public object CreateReadOnlyInterfaceListGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IReadOnlyList<IIntProperties>));
}
[Benchmark]
public object CreateReadOnlyClassListGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IReadOnlyList<EventOperations>));
}
[Benchmark]
public object CreateReadOnlyDelegateListGuid()
{
return WinRT.GuidGenerator.CreateIID(typeof(System.Collections.Generic.IReadOnlyList<ProvideInt>));
}
}
}
#endif