mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
[Benchmarks] Update/fix ShareableSet benchmarks
This commit is contained in:
1 parent
d9861ab322
commit
b985c6bc1d
2 files changed
+377
-252
No files matched your search
@@ -29,13 +29,24 @@
|
||||
"charts": [
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "union with Self",
|
||||
"title": "union with Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> union with Self (0% overlap)",
|
||||
"ShareableSet<Int> union with Self (25% overlap)",
|
||||
"ShareableSet<Int> union with Self (50% overlap)",
|
||||
"ShareableSet<Int> union with Self (75% overlap)",
|
||||
"ShareableSet<Int> union with Self (100% overlap)",
|
||||
"ShareableSet<Int> union with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "union with Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> union with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> union with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> union with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> union with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> union with Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -51,13 +62,24 @@
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "formUnion with Self",
|
||||
"title": "formUnion with Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> formUnion with Self (0% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (25% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (50% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (75% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (100% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "formUnion with Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> formUnion with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -78,13 +100,24 @@
|
||||
"charts": [
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "intersection with Self",
|
||||
"title": "intersection with Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> intersection with Self (0% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (25% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (50% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (75% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (100% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "intersection with Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> intersection with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -100,13 +133,24 @@
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "formIntersection with Self",
|
||||
"title": "formIntersection with Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> formIntersection with Self (0% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (25% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (50% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (75% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (100% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "formIntersection with Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> formIntersection with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -127,13 +171,24 @@
|
||||
"charts": [
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "symmetricDifference with Self",
|
||||
"title": "symmetricDifference with Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> symmetricDifference with Self (0% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (25% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (50% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (75% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (100% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "symmetricDifference with Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> symmetricDifference with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -149,13 +204,24 @@
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "formSymmetricDifference with Self",
|
||||
"title": "formSymmetricDifference with Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (0% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (25% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (50% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (75% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (100% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "formSymmetricDifference with Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -176,13 +242,24 @@
|
||||
"charts": [
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "subtracting Self",
|
||||
"title": "subtracting Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> subtracting Self (0% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (25% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (50% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (75% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (100% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "subtracting Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> subtracting Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -198,13 +275,24 @@
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "subtract Self",
|
||||
"title": "subtract Self, distinct",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> subtract Self (0% overlap)",
|
||||
"ShareableSet<Int> subtract Self (25% overlap)",
|
||||
"ShareableSet<Int> subtract Self (50% overlap)",
|
||||
"ShareableSet<Int> subtract Self (75% overlap)",
|
||||
"ShareableSet<Int> subtract Self (100% overlap)",
|
||||
"ShareableSet<Int> subtract Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (100% overlap, distinct)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "subtract Self, shared",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> subtract Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Self (100% overlap, shared)",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -292,15 +380,7 @@
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "diffing",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> insert one + subtract, shared",
|
||||
"Set<Int> insert one + subtract, shared",
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "chart",
|
||||
"title": "diffing2",
|
||||
"title": "model building with constant diffing",
|
||||
"tasks": [
|
||||
"ShareableSet<Int> model diffing",
|
||||
"Set<Int> model diffing",
|
||||
@@ -323,8 +403,9 @@
|
||||
"kind": "chart",
|
||||
"title": "union (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> union with Self (0% overlap)",
|
||||
"OrderedSet<Int> union with Array (0% overlap)",
|
||||
"ShareableSet<Int> union with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> union with Array (0% overlap)",
|
||||
"Set<Int> union with Self (0% overlap)",
|
||||
"Set<Int> union with Array (0% overlap)",
|
||||
]
|
||||
@@ -333,8 +414,9 @@
|
||||
"kind": "chart",
|
||||
"title": "union (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> union with Self (25% overlap)",
|
||||
"OrderedSet<Int> union with Array (25% overlap)",
|
||||
"ShareableSet<Int> union with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> union with Array (25% overlap)",
|
||||
"Set<Int> union with Self (25% overlap)",
|
||||
"Set<Int> union with Array (25% overlap)",
|
||||
]
|
||||
@@ -343,8 +425,9 @@
|
||||
"kind": "chart",
|
||||
"title": "union (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> union with Self (50% overlap)",
|
||||
"OrderedSet<Int> union with Array (50% overlap)",
|
||||
"ShareableSet<Int> union with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> union with Array (50% overlap)",
|
||||
"Set<Int> union with Self (50% overlap)",
|
||||
"Set<Int> union with Array (50% overlap)",
|
||||
]
|
||||
@@ -353,8 +436,9 @@
|
||||
"kind": "chart",
|
||||
"title": "union (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> union with Self (75% overlap)",
|
||||
"OrderedSet<Int> union with Array (75% overlap)",
|
||||
"ShareableSet<Int> union with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> union with Array (75% overlap)",
|
||||
"Set<Int> union with Self (75% overlap)",
|
||||
"Set<Int> union with Array (75% overlap)",
|
||||
]
|
||||
@@ -363,8 +447,9 @@
|
||||
"kind": "chart",
|
||||
"title": "union (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> union with Self (100% overlap)",
|
||||
"OrderedSet<Int> union with Array (100% overlap)",
|
||||
"ShareableSet<Int> union with Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> union with Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> union with Array (100% overlap)",
|
||||
"Set<Int> union with Self (100% overlap)",
|
||||
"Set<Int> union with Array (100% overlap)",
|
||||
]
|
||||
@@ -378,8 +463,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formUnion (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formUnion with Self (0% overlap)",
|
||||
"OrderedSet<Int> formUnion with Array (0% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Array (0% overlap)",
|
||||
"Set<Int> formUnion with Self (0% overlap)",
|
||||
"Set<Int> formUnion with Array (0% overlap)",
|
||||
]
|
||||
@@ -388,8 +474,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formUnion (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formUnion with Self (25% overlap)",
|
||||
"OrderedSet<Int> formUnion with Array (25% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Array (25% overlap)",
|
||||
"Set<Int> formUnion with Self (25% overlap)",
|
||||
"Set<Int> formUnion with Array (25% overlap)",
|
||||
]
|
||||
@@ -398,8 +485,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formUnion (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formUnion with Self (50% overlap)",
|
||||
"OrderedSet<Int> formUnion with Array (50% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Array (50% overlap)",
|
||||
"Set<Int> formUnion with Self (50% overlap)",
|
||||
"Set<Int> formUnion with Array (50% overlap)",
|
||||
]
|
||||
@@ -408,8 +496,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formUnion (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formUnion with Self (75% overlap)",
|
||||
"OrderedSet<Int> formUnion with Array (75% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Array (75% overlap)",
|
||||
"Set<Int> formUnion with Self (75% overlap)",
|
||||
"Set<Int> formUnion with Array (75% overlap)",
|
||||
]
|
||||
@@ -418,8 +507,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formUnion (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formUnion with Self (100% overlap)",
|
||||
"OrderedSet<Int> formUnion with Array (100% overlap)",
|
||||
"ShareableSet<Int> formUnion with Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> formUnion with Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> formUnion with Array (100% overlap)",
|
||||
"Set<Int> formUnion with Self (100% overlap)",
|
||||
"Set<Int> formUnion with Array (100% overlap)",
|
||||
]
|
||||
@@ -433,8 +523,9 @@
|
||||
"kind": "chart",
|
||||
"title": "intersection (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> intersection with Self (0% overlap)",
|
||||
"OrderedSet<Int> intersection with Array (0% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Array (0% overlap)",
|
||||
"Set<Int> intersection with Self (0% overlap)",
|
||||
"Set<Int> intersection with Array (0% overlap)",
|
||||
]
|
||||
@@ -443,8 +534,9 @@
|
||||
"kind": "chart",
|
||||
"title": "intersection (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> intersection with Self (25% overlap)",
|
||||
"OrderedSet<Int> intersection with Array (25% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Array (25% overlap)",
|
||||
"Set<Int> intersection with Self (25% overlap)",
|
||||
"Set<Int> intersection with Array (25% overlap)",
|
||||
]
|
||||
@@ -453,8 +545,9 @@
|
||||
"kind": "chart",
|
||||
"title": "intersection (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> intersection with Self (50% overlap)",
|
||||
"OrderedSet<Int> intersection with Array (50% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Array (50% overlap)",
|
||||
"Set<Int> intersection with Self (50% overlap)",
|
||||
"Set<Int> intersection with Array (50% overlap)",
|
||||
]
|
||||
@@ -463,8 +556,9 @@
|
||||
"kind": "chart",
|
||||
"title": "intersection (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> intersection with Self (75% overlap)",
|
||||
"OrderedSet<Int> intersection with Array (75% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Array (75% overlap)",
|
||||
"Set<Int> intersection with Self (75% overlap)",
|
||||
"Set<Int> intersection with Array (75% overlap)",
|
||||
]
|
||||
@@ -473,8 +567,9 @@
|
||||
"kind": "chart",
|
||||
"title": "intersection (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> intersection with Self (100% overlap)",
|
||||
"OrderedSet<Int> intersection with Array (100% overlap)",
|
||||
"ShareableSet<Int> intersection with Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> intersection with Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> intersection with Array (100% overlap)",
|
||||
"Set<Int> intersection with Self (100% overlap)",
|
||||
"Set<Int> intersection with Array (100% overlap)",
|
||||
]
|
||||
@@ -488,8 +583,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formIntersection (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formIntersection with Self (0% overlap)",
|
||||
"OrderedSet<Int> formIntersection with Array (0% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Array (0% overlap)",
|
||||
"Set<Int> formIntersection with Self (0% overlap)",
|
||||
"Set<Int> formIntersection with Array (0% overlap)",
|
||||
]
|
||||
@@ -498,8 +594,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formIntersection (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formIntersection with Self (25% overlap)",
|
||||
"OrderedSet<Int> formIntersection with Array (25% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Array (25% overlap)",
|
||||
"Set<Int> formIntersection with Self (25% overlap)",
|
||||
"Set<Int> formIntersection with Array (25% overlap)",
|
||||
]
|
||||
@@ -508,8 +605,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formIntersection (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formIntersection with Self (50% overlap)",
|
||||
"OrderedSet<Int> formIntersection with Array (50% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Array (50% overlap)",
|
||||
"Set<Int> formIntersection with Self (50% overlap)",
|
||||
"Set<Int> formIntersection with Array (50% overlap)",
|
||||
]
|
||||
@@ -518,8 +616,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formIntersection (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formIntersection with Self (75% overlap)",
|
||||
"OrderedSet<Int> formIntersection with Array (75% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Array (75% overlap)",
|
||||
"Set<Int> formIntersection with Self (75% overlap)",
|
||||
"Set<Int> formIntersection with Array (75% overlap)",
|
||||
]
|
||||
@@ -528,8 +627,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formIntersection (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formIntersection with Self (100% overlap)",
|
||||
"OrderedSet<Int> formIntersection with Array (100% overlap)",
|
||||
"ShareableSet<Int> formIntersection with Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> formIntersection with Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> formIntersection with Array (100% overlap)",
|
||||
"Set<Int> formIntersection with Self (100% overlap)",
|
||||
"Set<Int> formIntersection with Array (100% overlap)",
|
||||
]
|
||||
@@ -543,8 +643,9 @@
|
||||
"kind": "chart",
|
||||
"title": "symmetricDifference (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> symmetricDifference with Self (0% overlap)",
|
||||
"OrderedSet<Int> symmetricDifference with Array (0% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Array (0% overlap)",
|
||||
"Set<Int> symmetricDifference with Self (0% overlap)",
|
||||
"Set<Int> symmetricDifference with Array (0% overlap)",
|
||||
]
|
||||
@@ -553,8 +654,9 @@
|
||||
"kind": "chart",
|
||||
"title": "symmetricDifference (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> symmetricDifference with Self (25% overlap)",
|
||||
"OrderedSet<Int> symmetricDifference with Array (25% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Array (25% overlap)",
|
||||
"Set<Int> symmetricDifference with Self (25% overlap)",
|
||||
"Set<Int> symmetricDifference with Array (25% overlap)",
|
||||
]
|
||||
@@ -563,8 +665,9 @@
|
||||
"kind": "chart",
|
||||
"title": "symmetricDifference (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> symmetricDifference with Self (50% overlap)",
|
||||
"OrderedSet<Int> symmetricDifference with Array (50% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Array (50% overlap)",
|
||||
"Set<Int> symmetricDifference with Self (50% overlap)",
|
||||
"Set<Int> symmetricDifference with Array (50% overlap)",
|
||||
]
|
||||
@@ -573,8 +676,9 @@
|
||||
"kind": "chart",
|
||||
"title": "symmetricDifference (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> symmetricDifference with Self (75% overlap)",
|
||||
"OrderedSet<Int> symmetricDifference with Array (75% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Array (75% overlap)",
|
||||
"Set<Int> symmetricDifference with Self (75% overlap)",
|
||||
"Set<Int> symmetricDifference with Array (75% overlap)",
|
||||
]
|
||||
@@ -583,8 +687,9 @@
|
||||
"kind": "chart",
|
||||
"title": "symmetricDifference (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> symmetricDifference with Self (100% overlap)",
|
||||
"OrderedSet<Int> symmetricDifference with Array (100% overlap)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> symmetricDifference with Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> symmetricDifference with Array (100% overlap)",
|
||||
"Set<Int> symmetricDifference with Self (100% overlap)",
|
||||
"Set<Int> symmetricDifference with Array (100% overlap)",
|
||||
]
|
||||
@@ -598,8 +703,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formSymmetricDifference (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formSymmetricDifference with Self (0% overlap)",
|
||||
"OrderedSet<Int> formSymmetricDifference with Array (0% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Array (0% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Self (0% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Array (0% overlap)",
|
||||
]
|
||||
@@ -608,8 +714,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formSymmetricDifference (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formSymmetricDifference with Self (25% overlap)",
|
||||
"OrderedSet<Int> formSymmetricDifference with Array (25% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Array (25% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Self (25% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Array (25% overlap)",
|
||||
]
|
||||
@@ -618,8 +725,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formSymmetricDifference (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formSymmetricDifference with Self (50% overlap)",
|
||||
"OrderedSet<Int> formSymmetricDifference with Array (50% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Array (50% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Self (50% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Array (50% overlap)",
|
||||
]
|
||||
@@ -628,8 +736,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formSymmetricDifference (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formSymmetricDifference with Self (75% overlap)",
|
||||
"OrderedSet<Int> formSymmetricDifference with Array (75% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Array (75% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Self (75% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Array (75% overlap)",
|
||||
]
|
||||
@@ -638,8 +747,9 @@
|
||||
"kind": "chart",
|
||||
"title": "formSymmetricDifference (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> formSymmetricDifference with Self (100% overlap)",
|
||||
"OrderedSet<Int> formSymmetricDifference with Array (100% overlap)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> formSymmetricDifference with Array (100% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Self (100% overlap)",
|
||||
"Set<Int> formSymmetricDifference with Array (100% overlap)",
|
||||
]
|
||||
@@ -653,8 +763,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtracting (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtracting Self (0% overlap)",
|
||||
"OrderedSet<Int> subtracting Array (0% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Array (0% overlap)",
|
||||
"Set<Int> subtracting Self (0% overlap)",
|
||||
"Set<Int> subtracting Array (0% overlap)",
|
||||
]
|
||||
@@ -663,8 +774,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtracting (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtracting Self (25% overlap)",
|
||||
"OrderedSet<Int> subtracting Array (25% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Array (25% overlap)",
|
||||
"Set<Int> subtracting Self (25% overlap)",
|
||||
"Set<Int> subtracting Array (25% overlap)",
|
||||
]
|
||||
@@ -673,8 +785,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtracting (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtracting Self (50% overlap)",
|
||||
"OrderedSet<Int> subtracting Array (50% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Array (50% overlap)",
|
||||
"Set<Int> subtracting Self (50% overlap)",
|
||||
"Set<Int> subtracting Array (50% overlap)",
|
||||
]
|
||||
@@ -683,8 +796,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtracting (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtracting Self (75% overlap)",
|
||||
"OrderedSet<Int> subtracting Array (75% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Array (75% overlap)",
|
||||
"Set<Int> subtracting Self (75% overlap)",
|
||||
"Set<Int> subtracting Array (75% overlap)",
|
||||
]
|
||||
@@ -693,8 +807,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtracting (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtracting Self (100% overlap)",
|
||||
"OrderedSet<Int> subtracting Array (100% overlap)",
|
||||
"ShareableSet<Int> subtracting Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> subtracting Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> subtracting Array (100% overlap)",
|
||||
"Set<Int> subtracting Self (100% overlap)",
|
||||
"Set<Int> subtracting Array (100% overlap)",
|
||||
]
|
||||
@@ -708,8 +823,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtract (0% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtract Self (0% overlap)",
|
||||
"OrderedSet<Int> subtract Array (0% overlap)",
|
||||
"ShareableSet<Int> subtract Self (0% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (0% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Array (0% overlap)",
|
||||
"Set<Int> subtract Self (0% overlap)",
|
||||
"Set<Int> subtract Array (0% overlap)",
|
||||
]
|
||||
@@ -718,8 +834,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtract (25% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtract Self (25% overlap)",
|
||||
"OrderedSet<Int> subtract Array (25% overlap)",
|
||||
"ShareableSet<Int> subtract Self (25% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (25% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Array (25% overlap)",
|
||||
"Set<Int> subtract Self (25% overlap)",
|
||||
"Set<Int> subtract Array (25% overlap)",
|
||||
]
|
||||
@@ -728,8 +845,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtract (50% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtract Self (50% overlap)",
|
||||
"OrderedSet<Int> subtract Array (50% overlap)",
|
||||
"ShareableSet<Int> subtract Self (50% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (50% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Array (50% overlap)",
|
||||
"Set<Int> subtract Self (50% overlap)",
|
||||
"Set<Int> subtract Array (50% overlap)",
|
||||
]
|
||||
@@ -738,8 +856,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtract (75% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtract Self (75% overlap)",
|
||||
"OrderedSet<Int> subtract Array (75% overlap)",
|
||||
"ShareableSet<Int> subtract Self (75% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (75% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Array (75% overlap)",
|
||||
"Set<Int> subtract Self (75% overlap)",
|
||||
"Set<Int> subtract Array (75% overlap)",
|
||||
]
|
||||
@@ -748,8 +867,9 @@
|
||||
"kind": "chart",
|
||||
"title": "subtract (100% overlap)",
|
||||
"tasks": [
|
||||
"OrderedSet<Int> subtract Self (100% overlap)",
|
||||
"OrderedSet<Int> subtract Array (100% overlap)",
|
||||
"ShareableSet<Int> subtract Self (100% overlap, distinct)",
|
||||
"ShareableSet<Int> subtract Self (100% overlap, shared)",
|
||||
"ShareableSet<Int> subtract Array (100% overlap)",
|
||||
"Set<Int> subtract Self (100% overlap)",
|
||||
"Set<Int> subtract Array (100% overlap)",
|
||||
]
|
||||
|
||||
@@ -105,21 +105,6 @@ extension Benchmark {
|
||||
blackHole(set)
|
||||
}
|
||||
|
||||
self.add(
|
||||
title: "ShareableSet<Int> insert one + subtract, shared",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let original = ShareableSet(input)
|
||||
let newMember = input.count
|
||||
return { timer in
|
||||
var copy = original
|
||||
copy.insert(newMember)
|
||||
let diff = copy.subtracting(original)
|
||||
precondition(diff.count == 1 && diff.first == newMember)
|
||||
blackHole(copy)
|
||||
}
|
||||
}
|
||||
|
||||
self.addSimple(
|
||||
title: "ShareableSet<Int> model diffing",
|
||||
input: Int.self
|
||||
@@ -184,58 +169,68 @@ extension Benchmark {
|
||||
|
||||
// SetAlgebra operations with Self
|
||||
do {
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> union with Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
blackHole(a.union(identity(b)))
|
||||
}
|
||||
func makeB(
|
||||
_ a: ShareableSet<Int>, _ range: Range<Int>, shared: Bool
|
||||
) -> ShareableSet<Int> {
|
||||
guard shared else {
|
||||
return ShareableSet(range)
|
||||
}
|
||||
var b = a
|
||||
b.subtract(0 ..< range.lowerBound)
|
||||
b.formUnion(range)
|
||||
return b
|
||||
}
|
||||
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> intersection with Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
blackHole(a.intersection(identity(b)))
|
||||
}
|
||||
}
|
||||
}
|
||||
for shared in [false, true] {
|
||||
let qualifier = "\(percentage) overlap, \(shared ? "shared" : "distinct")"
|
||||
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> symmetricDifference with Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
blackHole(a.symmetricDifference(identity(b)))
|
||||
self.add(
|
||||
title: "ShareableSet<Int> union with Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
return { timer in
|
||||
blackHole(a.union(identity(b)))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> subtracting Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
blackHole(a.subtracting(identity(b)))
|
||||
self.add(
|
||||
title: "ShareableSet<Int> intersection with Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
return { timer in
|
||||
blackHole(a.intersection(identity(b)))
|
||||
}
|
||||
}
|
||||
|
||||
self.add(
|
||||
title: "ShareableSet<Int> symmetricDifference with Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
return { timer in
|
||||
blackHole(a.symmetricDifference(identity(b)))
|
||||
}
|
||||
}
|
||||
|
||||
self.add(
|
||||
title: "ShareableSet<Int> subtracting Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
return { timer in
|
||||
blackHole(a.subtracting(identity(b)))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,70 +297,80 @@ extension Benchmark {
|
||||
|
||||
// SetAlgebra mutations with Self
|
||||
do {
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> formUnion with Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
timer.measure {
|
||||
a.formUnion(identity(b))
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
func makeB(
|
||||
_ a: ShareableSet<Int>, _ range: Range<Int>, shared: Bool
|
||||
) -> ShareableSet<Int> {
|
||||
guard shared else {
|
||||
return ShareableSet(range)
|
||||
}
|
||||
var b = a
|
||||
b.subtract(0 ..< range.lowerBound)
|
||||
b.formUnion(range)
|
||||
return b
|
||||
}
|
||||
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> formIntersection with Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
timer.measure {
|
||||
a.formIntersection(identity(b))
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
}
|
||||
}
|
||||
for shared in [false, true] {
|
||||
let qualifier = "\(percentage) overlap, \(shared ? "shared" : "distinct")"
|
||||
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> formSymmetricDifference with Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
timer.measure {
|
||||
a.formSymmetricDifference(identity(b))
|
||||
self.add(
|
||||
title: "ShareableSet<Int> formUnion with Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
timer.measure {
|
||||
a.formUnion(identity(b))
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (percentage, start) in overlaps {
|
||||
self.add(
|
||||
title: "ShareableSet<Int> subtract Self (\(percentage) overlap)",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
let b = ShareableSet(start ..< start + input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
timer.measure {
|
||||
a.subtract(identity(b))
|
||||
self.add(
|
||||
title: "ShareableSet<Int> formIntersection with Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
timer.measure {
|
||||
a.formIntersection(identity(b))
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
}
|
||||
|
||||
self.add(
|
||||
title: "ShareableSet<Int> formSymmetricDifference with Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
timer.measure {
|
||||
a.formSymmetricDifference(identity(b))
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
}
|
||||
|
||||
self.add(
|
||||
title: "ShareableSet<Int> subtract Self (\(qualifier))",
|
||||
input: [Int].self
|
||||
) { input in
|
||||
let start = start(input.count)
|
||||
return { timer in
|
||||
var a = ShareableSet(input)
|
||||
let b = makeB(a, start ..< start + input.count, shared: shared)
|
||||
timer.measure {
|
||||
a.subtract(identity(b))
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
blackHole(a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user