Skip to content

Commit c011bd7

Browse files
committed
[benchmark] Add swapped Set.*.Empty variants
Let’s also test Empty sets as the right-hand side parameter.
1 parent 84580f8 commit c011bd7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

benchmark/single-source/SetTests.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public let SetTests = [
6262
runFunction: { n in run_SetIsSubsetInt(setE, setAB, true, 5000 * n) },
6363
tags: [.validation, .api, .Set],
6464
setUpFunction: { blackHole([setE, setAB]) }),
65+
BenchmarkInfo(
66+
name: "Set.isSubset.Int0.Empty",
67+
runFunction: { n in run_SetIsSubsetInt(setAB, setE, false, 5000 * n) },
68+
tags: [.validation, .api, .Set],
69+
setUpFunction: { blackHole([setAB, setE]) }),
6570
BenchmarkInfo(
6671
name: "SetIsSubsetInt0",
6772
runFunction: { n in run_SetIsSubsetInt(setAB, setCD, false, 5000 * n) },
@@ -98,11 +103,21 @@ public let SetTests = [
98103
runFunction: { n in run_SetIsDisjointInt(setE, setAB, true, 50 * n) },
99104
tags: [.validation, .api, .Set],
100105
setUpFunction: { blackHole([setE, setAB]) }),
106+
BenchmarkInfo(
107+
name: "Set.isDisjoint.Int0.Empty",
108+
runFunction: { n in run_SetIsDisjointInt(setAB, setE, true, 50 * n) },
109+
tags: [.validation, .api, .Set],
110+
setUpFunction: { blackHole([setAB, setE]) }),
101111
BenchmarkInfo(
102112
name: "Set.isDisjoint.Empty.Box0",
103113
runFunction: { n in run_SetIsDisjointBox(setOE, setOAB, true, 50 * n) },
104114
tags: [.validation, .api, .Set],
105115
setUpFunction: { blackHole([setOE, setOAB]) }),
116+
BenchmarkInfo(
117+
name: "Set.isDisjoint.Box0.Empty",
118+
runFunction: { n in run_SetIsDisjointBox(setOAB, setOE, true, 50 * n) },
119+
tags: [.validation, .api, .Set],
120+
setUpFunction: { blackHole([setOAB, setOE]) }),
106121
BenchmarkInfo(
107122
name: "Set.isDisjoint.Int0",
108123
runFunction: { n in run_SetIsDisjointInt(setAB, setCD, true, 50 * n) },
@@ -232,11 +247,21 @@ public let SetTests = [
232247
runFunction: { n in run_SetSubtractingInt(setE, setAB, 0, 10 * n) },
233248
tags: [.validation, .api, .Set],
234249
setUpFunction: { blackHole([setE, setAB]) }),
250+
BenchmarkInfo(
251+
name: "Set.subtracting.Int0.Empty",
252+
runFunction: { n in run_SetSubtractingInt(setAB, setE, countAB, 10 * n) },
253+
tags: [.validation, .api, .Set],
254+
setUpFunction: { blackHole([setAB, setE]) }),
235255
BenchmarkInfo(
236256
name: "Set.subtracting.Empty.Box0",
237257
runFunction: { n in run_SetSubtractingBox(setOE, setOAB, 0, 10 * n) },
238258
tags: [.validation, .api, .Set],
239259
setUpFunction: { blackHole([setOE, setOAB]) }),
260+
BenchmarkInfo(
261+
name: "Set.subtracting.Box0.Empty",
262+
runFunction: { n in run_SetSubtractingBox(setOAB, setOE, countAB, 10 * n) },
263+
tags: [.validation, .api, .Set],
264+
setUpFunction: { blackHole([setOAB, setOE]) }),
240265
BenchmarkInfo(
241266
name: "SetSubtractingInt0",
242267
runFunction: { n in run_SetSubtractingInt(setAB, setCD, countAB, 10 * n) },

0 commit comments

Comments
 (0)