|
3 | 3 | using BenchmarkDotNet.Attributes; |
4 | 4 | using Microsoft.OpenApi.Models; |
5 | 5 |
|
6 | | -namespace performance |
| 6 | +namespace performance; |
| 7 | +[MemoryDiagnoser] |
| 8 | +[JsonExporter] |
| 9 | +[ShortRunJob] |
| 10 | +// [SimpleJob(launchCount: 1, warmupCount: 30, iterationCount: 50, invocationCount:1000)] |
| 11 | +public class EmptyModels |
7 | 12 | { |
8 | | - [MemoryDiagnoser] |
9 | | - [JsonExporter] |
10 | | - [ShortRunJob] |
11 | | - // [SimpleJob(launchCount: 1, warmupCount: 30, iterationCount: 50, invocationCount:1000)] |
12 | | - public class EmptyModels |
13 | | - { |
14 | | - [Benchmark] |
15 | | - public OpenApiCallback EmptyApiCallback() |
16 | | - { |
17 | | - return new OpenApiCallback(); |
18 | | - } |
19 | | - [Benchmark] |
20 | | - public OpenApiComponents EmptyApiComponents() |
21 | | - { |
22 | | - return new OpenApiComponents(); |
23 | | - } |
24 | | - [Benchmark] |
25 | | - public OpenApiContact EmptyApiContact() |
26 | | - { |
27 | | - return new OpenApiContact(); |
28 | | - } |
29 | | - [Benchmark] |
30 | | - public OpenApiDiscriminator EmptyApiDiscriminator() |
31 | | - { |
32 | | - return new OpenApiDiscriminator(); |
33 | | - } |
34 | | - [Benchmark] |
35 | | - public OpenApiDocument EmptyDocument() |
36 | | - { |
37 | | - return new OpenApiDocument(); |
38 | | - } |
39 | | - [Benchmark] |
40 | | - public OpenApiEncoding EmptyApiEncoding() |
41 | | - { |
42 | | - return new OpenApiEncoding(); |
43 | | - } |
44 | | - [Benchmark] |
45 | | - public OpenApiExample EmptyApiExample() |
46 | | - { |
47 | | - return new OpenApiExample(); |
48 | | - } |
49 | | - [Benchmark] |
50 | | - public OpenApiExternalDocs EmptyApiExternalDocs() |
51 | | - { |
52 | | - return new OpenApiExternalDocs(); |
53 | | - } |
54 | | - [Benchmark] |
55 | | - public OpenApiHeader EmptyApiHeader() |
56 | | - { |
57 | | - return new OpenApiHeader(); |
58 | | - } |
59 | | - [Benchmark] |
60 | | - public OpenApiInfo EmptyApiInfo() |
61 | | - { |
62 | | - return new OpenApiInfo(); |
63 | | - } |
64 | | - [Benchmark] |
65 | | - public OpenApiLicense EmptyApiLicense() |
66 | | - { |
67 | | - return new OpenApiLicense(); |
68 | | - } |
69 | | - [Benchmark] |
70 | | - public OpenApiLink EmptyApiLink() |
71 | | - { |
72 | | - return new OpenApiLink(); |
73 | | - } |
74 | | - [Benchmark] |
75 | | - public OpenApiMediaType EmptyApiMediaType() |
76 | | - { |
77 | | - return new OpenApiMediaType(); |
78 | | - } |
79 | | - [Benchmark] |
80 | | - public OpenApiOAuthFlow EmptyApiOAuthFlow() |
81 | | - { |
82 | | - return new OpenApiOAuthFlow(); |
83 | | - } |
84 | | - [Benchmark] |
85 | | - public OpenApiOAuthFlows EmptyApiOAuthFlows() |
86 | | - { |
87 | | - return new OpenApiOAuthFlows(); |
88 | | - } |
89 | | - [Benchmark] |
90 | | - public OpenApiOperation EmptyApiOperation() |
91 | | - { |
92 | | - return new OpenApiOperation(); |
93 | | - } |
94 | | - [Benchmark] |
95 | | - public OpenApiParameter EmptyApiParameter() |
96 | | - { |
97 | | - return new OpenApiParameter(); |
98 | | - } |
99 | | - [Benchmark] |
100 | | - public OpenApiPathItem EmptyApiPathItem() |
101 | | - { |
102 | | - return new OpenApiPathItem(); |
103 | | - } |
104 | | - [Benchmark] |
105 | | - public OpenApiPaths EmptyApiPaths() |
106 | | - { |
107 | | - return new OpenApiPaths(); |
108 | | - } |
109 | | - [Benchmark] |
110 | | - public OpenApiRequestBody EmptyApiRequestBody() |
111 | | - { |
112 | | - return new OpenApiRequestBody(); |
113 | | - } |
114 | | - [Benchmark] |
115 | | - public OpenApiResponse EmptyApiResponse() |
116 | | - { |
117 | | - return new OpenApiResponse(); |
118 | | - } |
119 | | - [Benchmark] |
120 | | - public OpenApiResponses EmptyApiResponses() |
121 | | - { |
122 | | - return new OpenApiResponses(); |
123 | | - } |
124 | | - [Benchmark] |
125 | | - public OpenApiSchema EmptyApiSchema() |
126 | | - { |
127 | | - return new OpenApiSchema(); |
128 | | - } |
129 | | - [Benchmark] |
130 | | - public OpenApiSecurityRequirement EmptyApiSecurityRequirement() |
131 | | - { |
132 | | - return new OpenApiSecurityRequirement(); |
133 | | - } |
134 | | - [Benchmark] |
135 | | - public OpenApiSecurityScheme EmptyApiSecurityScheme() |
136 | | - { |
137 | | - return new OpenApiSecurityScheme(); |
138 | | - } |
139 | | - [Benchmark] |
140 | | - public OpenApiServer EmptyApiServer() |
141 | | - { |
142 | | - return new OpenApiServer(); |
143 | | - } |
144 | | - [Benchmark] |
145 | | - public OpenApiServerVariable EmptyApiServerVariable() |
146 | | - { |
147 | | - return new OpenApiServerVariable(); |
148 | | - } |
149 | | - [Benchmark] |
150 | | - public OpenApiTag EmptyApiTag() |
151 | | - { |
152 | | - return new OpenApiTag(); |
153 | | - } |
| 13 | + [Benchmark] |
| 14 | + public OpenApiCallback EmptyApiCallback() |
| 15 | + { |
| 16 | + return new OpenApiCallback(); |
| 17 | + } |
| 18 | + [Benchmark] |
| 19 | + public OpenApiComponents EmptyApiComponents() |
| 20 | + { |
| 21 | + return new OpenApiComponents(); |
| 22 | + } |
| 23 | + [Benchmark] |
| 24 | + public OpenApiContact EmptyApiContact() |
| 25 | + { |
| 26 | + return new OpenApiContact(); |
| 27 | + } |
| 28 | + [Benchmark] |
| 29 | + public OpenApiDiscriminator EmptyApiDiscriminator() |
| 30 | + { |
| 31 | + return new OpenApiDiscriminator(); |
| 32 | + } |
| 33 | + [Benchmark] |
| 34 | + public OpenApiDocument EmptyDocument() |
| 35 | + { |
| 36 | + return new OpenApiDocument(); |
| 37 | + } |
| 38 | + [Benchmark] |
| 39 | + public OpenApiEncoding EmptyApiEncoding() |
| 40 | + { |
| 41 | + return new OpenApiEncoding(); |
| 42 | + } |
| 43 | + [Benchmark] |
| 44 | + public OpenApiExample EmptyApiExample() |
| 45 | + { |
| 46 | + return new OpenApiExample(); |
| 47 | + } |
| 48 | + [Benchmark] |
| 49 | + public OpenApiExternalDocs EmptyApiExternalDocs() |
| 50 | + { |
| 51 | + return new OpenApiExternalDocs(); |
| 52 | + } |
| 53 | + [Benchmark] |
| 54 | + public OpenApiHeader EmptyApiHeader() |
| 55 | + { |
| 56 | + return new OpenApiHeader(); |
| 57 | + } |
| 58 | + [Benchmark] |
| 59 | + public OpenApiInfo EmptyApiInfo() |
| 60 | + { |
| 61 | + return new OpenApiInfo(); |
| 62 | + } |
| 63 | + [Benchmark] |
| 64 | + public OpenApiLicense EmptyApiLicense() |
| 65 | + { |
| 66 | + return new OpenApiLicense(); |
| 67 | + } |
| 68 | + [Benchmark] |
| 69 | + public OpenApiLink EmptyApiLink() |
| 70 | + { |
| 71 | + return new OpenApiLink(); |
| 72 | + } |
| 73 | + [Benchmark] |
| 74 | + public OpenApiMediaType EmptyApiMediaType() |
| 75 | + { |
| 76 | + return new OpenApiMediaType(); |
| 77 | + } |
| 78 | + [Benchmark] |
| 79 | + public OpenApiOAuthFlow EmptyApiOAuthFlow() |
| 80 | + { |
| 81 | + return new OpenApiOAuthFlow(); |
| 82 | + } |
| 83 | + [Benchmark] |
| 84 | + public OpenApiOAuthFlows EmptyApiOAuthFlows() |
| 85 | + { |
| 86 | + return new OpenApiOAuthFlows(); |
| 87 | + } |
| 88 | + [Benchmark] |
| 89 | + public OpenApiOperation EmptyApiOperation() |
| 90 | + { |
| 91 | + return new OpenApiOperation(); |
| 92 | + } |
| 93 | + [Benchmark] |
| 94 | + public OpenApiParameter EmptyApiParameter() |
| 95 | + { |
| 96 | + return new OpenApiParameter(); |
| 97 | + } |
| 98 | + [Benchmark] |
| 99 | + public OpenApiPathItem EmptyApiPathItem() |
| 100 | + { |
| 101 | + return new OpenApiPathItem(); |
| 102 | + } |
| 103 | + [Benchmark] |
| 104 | + public OpenApiPaths EmptyApiPaths() |
| 105 | + { |
| 106 | + return new OpenApiPaths(); |
| 107 | + } |
| 108 | + [Benchmark] |
| 109 | + public OpenApiRequestBody EmptyApiRequestBody() |
| 110 | + { |
| 111 | + return new OpenApiRequestBody(); |
| 112 | + } |
| 113 | + [Benchmark] |
| 114 | + public OpenApiResponse EmptyApiResponse() |
| 115 | + { |
| 116 | + return new OpenApiResponse(); |
| 117 | + } |
| 118 | + [Benchmark] |
| 119 | + public OpenApiResponses EmptyApiResponses() |
| 120 | + { |
| 121 | + return new OpenApiResponses(); |
| 122 | + } |
| 123 | + [Benchmark] |
| 124 | + public OpenApiSchema EmptyApiSchema() |
| 125 | + { |
| 126 | + return new OpenApiSchema(); |
| 127 | + } |
| 128 | + [Benchmark] |
| 129 | + public OpenApiSecurityRequirement EmptyApiSecurityRequirement() |
| 130 | + { |
| 131 | + return new OpenApiSecurityRequirement(); |
| 132 | + } |
| 133 | + [Benchmark] |
| 134 | + public OpenApiSecurityScheme EmptyApiSecurityScheme() |
| 135 | + { |
| 136 | + return new OpenApiSecurityScheme(); |
| 137 | + } |
| 138 | + [Benchmark] |
| 139 | + public OpenApiServer EmptyApiServer() |
| 140 | + { |
| 141 | + return new OpenApiServer(); |
| 142 | + } |
| 143 | + [Benchmark] |
| 144 | + public OpenApiServerVariable EmptyApiServerVariable() |
| 145 | + { |
| 146 | + return new OpenApiServerVariable(); |
| 147 | + } |
| 148 | + [Benchmark] |
| 149 | + public OpenApiTag EmptyApiTag() |
| 150 | + { |
| 151 | + return new OpenApiTag(); |
154 | 152 | } |
155 | 153 | } |
0 commit comments