diff --git a/Benchmarks/Libraries/Array.json b/Benchmarks/Libraries/Array.json new file mode 100644 index 00000000..429d6b5f --- /dev/null +++ b/Benchmarks/Libraries/Array.json @@ -0,0 +1,140 @@ +{ + "kind": "group", + "title": "Array Benchmarks", + "directory": "Array", + "contents": [ + { + "kind": "group", + "title": "Operations", + "directory": "operations", + "contents": [ + { + "kind": "chart", + "title": "operations", + "tasks": [ + "Array init from unsafe buffer", + "Array sequential iteration", + "Array subscript get, random offsets", + "Array append", + "Array append, reserving capacity", + "Array prepend", + "Array prepend, reserving capacity", + "Array removeFirst", + "Array removeLast", + "Array sort" + ] + }, + { + "kind": "chart", + "title": "access", + "tasks": [ + "Array sequential iteration", + "Array subscript get, random offsets" + ] + }, + { + "kind": "chart", + "title": "mutate", + "tasks": [ + "Array mutate through subscript", + "Array random swaps", + "Array partitioning around middle", + "Array sort" + ] + } + ] + }, + { + "kind": "group", + "title": "Array vs std::vector", + "directory": "versus STL vector", + "contents": [ + { + "kind": "chart", + "title": "init from buffer of integers", + "tasks": [ + "std::vector constructor from buffer", + "Array init from unsafe buffer" + ] + }, + { + "kind": "chart", + "title": "sequential iteration", + "tasks": [ + "std::vector sequential iteration", + "Array sequential iteration" + ] + }, + { + "kind": "chart", + "title": "random-access offset lookups", + "tasks": [ + "std::vector random-access offset lookups (operator [])", + "std::vector random-access offset lookups (at)", + "Array subscript get, random offsets" + ] + }, + { + "kind": "chart", + "title": "append individual integers", + "tasks": [ + "std::vector push_back", + "std::vector push_back, reserving capacity", + "Array append", + "Array append, reserving capacity" + ] + }, + { + "kind": "chart", + "title": "prepend individual integers", + "tasks": [ + "std::vector insert at front", + "std::vector insert at front, reserving capacity", + "Array prepend", + "Array prepend, reserving capacity" + ] + }, + { + "kind": "chart", + "title": "random insertions", + "tasks": [ + "std::vector random insertions", + "Array random insertions" + ] + }, + { + "kind": "chart", + "title": "removeFirst", + "tasks": [ + "std::vector erase first", + "Array removeFirst" + ] + }, + { + "kind": "chart", + "title": "removeLast", + "tasks": [ + "std::vector pop_back", + "Array removeLast" + ] + }, + { + "kind": "chart", + "title": "random removals", + "tasks": [ + "std::vector random removals", + "Array random removals" + ] + }, + { + "kind": "chart", + "title": "sort", + "tasks": [ + "std::vector sort", + "Array sort" + ] + } + ] + } + ] +} diff --git a/Benchmarks/Libraries/BitSet.json b/Benchmarks/Libraries/BitSet.json index 900631a5..3d9e0a52 100644 --- a/Benchmarks/Libraries/BitSet.json +++ b/Benchmarks/Libraries/BitSet.json @@ -1,7 +1,7 @@ { "kind": "group", - "title": "Bitset Benchmarks", - "directory": "Results", + "title": "BitSet Benchmarks", + "directory": "BitSet", "contents": [ { "kind": "group", diff --git a/Benchmarks/Libraries/Deque.json b/Benchmarks/Libraries/Deque.json new file mode 100644 index 00000000..1d1adb1e --- /dev/null +++ b/Benchmarks/Libraries/Deque.json @@ -0,0 +1,309 @@ +{ + "kind": "group", + "title": "Deque Benchmarks", + "directory": "Deque", + "contents": [ + { + "kind": "group", + "title": "Operations", + "directory": "operations", + "contents": [ + { + "kind": "chart", + "title": "operations", + "tasks": [ + "Deque init from unsafe buffer", + "Deque sequential iteration (contiguous, iterator)", + "Deque subscript get, random offsets (contiguous)", + "Deque append", + "Deque append, reserving capacity", + "Deque prepend", + "Deque prepend, reserving capacity", + "Deque removeFirst (contiguous)", + "Deque removeLast (contiguous)", + "Deque sort (contiguous)", + "Deque sort (discontiguous)" + ] + }, + { + "kind": "chart", + "title": "iteration", + "tasks": [ + "Deque sequential iteration (contiguous, iterator)", + "Deque sequential iteration (discontiguous, iterator)", + "Deque sequential iteration (contiguous, indices)", + "Deque sequential iteration (discontiguous, indices)" + ] + }, + { + "kind": "chart", + "title": "access", + "tasks": [ + "Deque subscript get, random offsets (contiguous)", + "Deque subscript get, random offsets (discontiguous)", + "Deque mutate through subscript (contiguous)", + "Deque mutate through subscript (discontiguous)" + ] + }, + { + "kind": "chart", + "title": "mutate", + "tasks": [ + "Deque mutate through subscript (contiguous)", + "Deque mutate through subscript (discontiguous)", + "Deque random swaps (contiguous)", + "Deque random swaps (discontiguous)", + "Deque partitioning around middle (contiguous)", + "Deque partitioning around middle (discontiguous)", + "Deque sort (contiguous)", + "Deque sort (discontiguous)" + ] + }, + { + "kind": "chart", + "title": "push", + "tasks": [ + "Deque append", + "Deque append, reserving capacity", + "Deque prepend", + "Deque prepend, reserving capacity" + ] + }, + { + "kind": "chart", + "title": "pop", + "tasks": [ + "Deque removeFirst (contiguous)", + "Deque removeFirst (discontiguous)", + "Deque removeLast (contiguous)", + "Deque removeLast (discontiguous)" + ] + } + ] + }, + { + "kind": "group", + "title": "Deque vs Array", + "directory": "versus Array", + "contents": [ + { + "kind": "chart", + "title": "init from buffer of integers", + "tasks": [ + "Deque init from unsafe buffer", + "Array init from unsafe buffer" + ] + }, + { + "kind": "chart", + "title": "sequential iteration", + "tasks": [ + "Deque sequential iteration (contiguous, iterator)", + "Deque sequential iteration (contiguous, indices)", + "Deque sequential iteration (discontiguous, iterator)", + "Deque sequential iteration (discontiguous, indices)", + "Array sequential iteration" + ] + }, + { + "kind": "chart", + "title": "random-access offset lookups", + "tasks": [ + "Deque subscript get, random offsets (contiguous)", + "Deque subscript get, random offsets (discontiguous)", + "Array subscript get, random offsets" + ] + }, + { + "kind": "chart", + "title": "mutate through subscript", + "tasks": [ + "Deque mutate through subscript (contiguous)", + "Deque mutate through subscript (discontiguous)", + "Array mutate through subscript" + ] + }, + { + "kind": "chart", + "title": "random swaps", + "tasks": [ + "Deque random swaps (contiguous)", + "Deque random swaps (discontiguous)", + "Array random swaps" + ] + }, + { + "kind": "chart", + "title": "partitioning around middle", + "tasks": [ + "Deque partitioning around middle (contiguous)", + "Deque partitioning around middle (discontiguous)", + "Array partitioning around middle" + ] + }, + { + "kind": "chart", + "title": "sort", + "tasks": [ + "Deque sort (contiguous)", + "Deque sort (discontiguous)", + "Array sort" + ] + }, + { + "kind": "chart", + "title": "append individual integers", + "tasks": [ + "Deque append", + "Deque append, reserving capacity", + "Array append", + "Array append, reserving capacity" + ] + }, + { + "kind": "chart", + "title": "prepend individual integers", + "tasks": [ + "Deque prepend", + "Deque prepend, reserving capacity", + "Array prepend", + "Array prepend, reserving capacity" + ] + }, + { + "kind": "chart", + "title": "random insertions", + "tasks": [ + "Deque random insertions", + "Array random insertions" + ] + }, + { + "kind": "chart", + "title": "removeFirst", + "tasks": [ + "Deque removeFirst (contiguous)", + "Deque removeFirst (discontiguous)", + "Array removeFirst" + ] + }, + { + "kind": "chart", + "title": "removeLast", + "tasks": [ + "Deque removeLast (contiguous)", + "Deque removeLast (discontiguous)", + "Array removeLast" + ] + }, + { + "kind": "chart", + "title": "random removals", + "tasks": [ + "Deque random removals (contiguous)", + "Deque random removals (discontiguous)", + "Array random removals" + ] + } + ] + }, + { + "kind": "group", + "title": "Deque vs std::deque", + "directory": "versus STL deque", + "contents": [ + { + "kind": "chart", + "title": "init from buffer of integers", + "tasks": [ + "std::deque constructor from buffer", + "Deque init from unsafe buffer" + ] + }, + { + "kind": "chart", + "title": "sequential iteration", + "tasks": [ + "std::deque sequential iteration", + "Deque sequential iteration (contiguous, iterator)", + "Deque sequential iteration (contiguous, indices)", + "Deque sequential iteration (discontiguous, iterator)", + "Deque sequential iteration (discontiguous, indices)" + ] + }, + { + "kind": "chart", + "title": "random-access offset lookups", + "tasks": [ + "std::deque random-access offset lookups (operator [])", + "std::deque at, random offsets", + "Deque subscript get, random offsets (contiguous)", + "Deque subscript get, random offsets (discontiguous)" + ] + }, + { + "kind": "chart", + "title": "append individual integers", + "tasks": [ + "std::deque push_back", + "Deque append", + "Deque append, reserving capacity" + ] + }, + { + "kind": "chart", + "title": "prepend individual integers", + "tasks": [ + "std::deque push_front", + "Deque prepend", + "Deque prepend, reserving capacity" + ] + }, + { + "kind": "chart", + "title": "random insertions", + "tasks": [ + "std::deque random insertions", + "Deque random insertions" + ] + }, + { + "kind": "chart", + "title": "removeFirst", + "tasks": [ + "std::deque pop_front", + "Deque removeFirst (contiguous)", + "Deque removeFirst (discontiguous)" + ] + }, + { + "kind": "chart", + "title": "removeLast", + "tasks": [ + "std::deque pop_back", + "Deque removeLast (contiguous)", + "Deque removeLast (discontiguous)" + ] + }, + { + "kind": "chart", + "title": "random removals", + "tasks": [ + "std::deque random removals", + "Deque random removals (contiguous)", + "Deque random removals (discontiguous)" + ] + }, + { + "kind": "chart", + "title": "sort", + "tasks": [ + "std::deque sort", + "Deque sort (contiguous)", + "Deque sort (discontiguous)" + ] + } + ] + } + ] +} diff --git a/Benchmarks/Libraries/Dictionary.json b/Benchmarks/Libraries/Dictionary.json new file mode 100644 index 00000000..4c9f108c --- /dev/null +++ b/Benchmarks/Libraries/Dictionary.json @@ -0,0 +1,92 @@ +{ + "kind": "group", + "title": "Dictionary Benchmarks", + "directory": "Dictionary", + "contents": [ + { + "kind": "group", + "title": "Operations", + "directory": "operations", + "contents": [ + { + "kind": "chart", + "title": "operations", + "tasks": [ + "Dictionary init(uniqueKeysWithValues:)", + "Dictionary sequential iteration", + "Dictionary subscript, successful lookups", + "Dictionary subscript, insert, unique", + "Dictionary subscript, remove existing, unique" + ] + }, + { + "kind": "chart", + "title": "iteration", + "tasks": [ + "Dictionary sequential iteration", + "Dictionary.Keys sequential iteration", + "Dictionary.Values sequential iteration", + "Dictionary sequential iteration, indices" + ] + }, + { + "kind": "chart", + "title": "lookups", + "tasks": [ + "Dictionary subscript, successful lookups", + "Dictionary subscript, unsuccessful lookups", + "Dictionary defaulted subscript, successful lookups", + "Dictionary defaulted subscript, unsuccessful lookups", + "Dictionary successful index(forKey:)", + "Dictionary unsuccessful index(forKey:)" + ] + }, + { + "kind": "chart", + "title": "subscript", + "tasks": [ + "Dictionary subscript, successful lookups", + "Dictionary subscript, unsuccessful lookups", + "Dictionary subscript, noop setter", + "Dictionary subscript, set existing", + "Dictionary subscript, _modify", + "Dictionary subscript, insert, unique", + "Dictionary subscript, insert, reserving capacity", + "Dictionary subscript, remove existing, unique", + "Dictionary subscript, remove missing" + ] + }, + { + "kind": "chart", + "title": "defaulted subscript", + "tasks": [ + "Dictionary defaulted subscript, successful lookups", + "Dictionary defaulted subscript, unsuccessful lookups", + "Dictionary defaulted subscript, _modify existing", + "Dictionary defaulted subscript, _modify missing" + ] + }, + { + "kind": "chart", + "title": "mutations", + "tasks": [ + "Dictionary updateValue(_:forKey:), existing", + "Dictionary subscript, set existing", + "Dictionary subscript, _modify", + "Dictionary defaulted subscript, _modify existing" + ] + }, + { + "kind": "chart", + "title": "removals", + "tasks": [ + "Dictionary subscript, remove existing, unique", + "Dictionary subscript, remove missing", + "Dictionary random removals (existing keys)", + "Dictionary random removals (missing keys)" + ] + } + ] + } + ] +} diff --git a/Benchmarks/Libraries/Heap.json b/Benchmarks/Libraries/Heap.json index 3e4e2e04..e3fd304e 100644 --- a/Benchmarks/Libraries/Heap.json +++ b/Benchmarks/Libraries/Heap.json @@ -1,7 +1,7 @@ { "kind": "group", "title": "Heap Benchmarks", - "directory": "Results", + "directory": "Heap", "contents": [ { "kind": "group", @@ -46,8 +46,8 @@ }, { "kind": "group", - "title": "Heap vs std::priority_queue", - "directory": "Heap + priority_queue", + "title": "Heap vs CFBinaryHeap and std::priority_queue", + "directory": "versus", "contents": [ { "kind": "chart", diff --git a/Benchmarks/Libraries/OrderedDictionary.json b/Benchmarks/Libraries/OrderedDictionary.json new file mode 100644 index 00000000..ef47f48b --- /dev/null +++ b/Benchmarks/Libraries/OrderedDictionary.json @@ -0,0 +1,357 @@ +{ + "kind": "group", + "title": "OrderedDictionary", + "directory": "OrderedDictionary", + "contents": [ + { + "kind": "group", + "title": "Operations", + "directory": "operations", + "contents": [ + { + "kind": "chart", + "title": "operations", + "tasks": [ + "OrderedDictionary init(uniqueKeysWithValues:)", + "OrderedDictionary sequential iteration", + "OrderedDictionary subscript, successful lookups", + "OrderedDictionary subscript, append, unique", + "OrderedDictionary subscript, remove existing, unique", + ] + }, + { + "kind": "chart", + "title": "initializers", + "tasks": [ + "OrderedDictionary init(uniqueKeysWithValues:)", + "OrderedDictionary init(uncheckedUniqueKeysWithValues:)", + "OrderedDictionary init(uncheckedUniqueKeys:values:)" + ] + }, + { + "kind": "chart", + "title": "iteration", + "tasks": [ + "OrderedDictionary sequential iteration", + "OrderedDictionary.Keys sequential iteration", + "OrderedDictionary.Values sequential iteration" + ] + }, + { + "kind": "chart", + "title": "lookups", + "tasks": [ + "OrderedDictionary subscript, successful lookups", + "OrderedDictionary subscript, unsuccessful lookups", + "OrderedDictionary defaulted subscript, successful lookups", + "OrderedDictionary defaulted subscript, unsuccessful lookups", + "OrderedDictionary successful index(forKey:)", + "OrderedDictionary unsuccessful index(forKey:)", + ] + }, + { + "kind": "chart", + "title": "subscript", + "tasks": [ + "OrderedDictionary subscript, successful lookups", + "OrderedDictionary subscript, unsuccessful lookups", + "OrderedDictionary subscript, noop setter", + "OrderedDictionary subscript, set existing", + "OrderedDictionary subscript, _modify", + "OrderedDictionary subscript, append, unique", + "OrderedDictionary subscript, append, reserving capacity", + "OrderedDictionary subscript, remove existing, unique", + "OrderedDictionary subscript, remove missing", + ] + }, + { + "kind": "chart", + "title": "defaulted subscript", + "tasks": [ + "OrderedDictionary defaulted subscript, successful lookups", + "OrderedDictionary defaulted subscript, unsuccessful lookups", + "OrderedDictionary defaulted subscript, _modify existing", + "OrderedDictionary defaulted subscript, _modify missing", + ] + }, + { + "kind": "chart", + "title": "mutations", + "tasks": [ + "OrderedDictionary updateValue(_:forKey:), existing", + "OrderedDictionary subscript, set existing", + "OrderedDictionary subscript, _modify", + "OrderedDictionary defaulted subscript, _modify existing", + "OrderedDictionary random swaps", + "OrderedDictionary partitioning around middle", + "OrderedDictionary sort", + ] + }, + { + "kind": "chart", + "title": "removals", + "tasks": [ + "OrderedDictionary subscript, remove existing, unique", + "OrderedDictionary subscript, remove missing", + "OrderedDictionary removeLast", + "OrderedDictionary removeFirst", + "OrderedDictionary random removals (offset-based)", + "OrderedDictionary random removals (existing keys)", + "OrderedDictionary random removals (missing keys)", + ] + } + ] + }, + { + "kind": "group", + "title": "OrderedDictionary vs Dictionary", + "directory": "versus Dictionary", + "contents": [ + { + "kind": "chart", + "title": "initializers", + "tasks": [ + "Dictionary init(uniqueKeysWithValues:)", + "OrderedDictionary init(uniqueKeysWithValues:)", + "OrderedDictionary init(uncheckedUniqueKeysWithValues:)", + "OrderedDictionary init(uncheckedUniqueKeys:values:)" + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "iteration", + "tasks": [ + "Dictionary sequential iteration", + "OrderedDictionary sequential iteration", + ] + }, + { + "kind": "chart", + "title": "Keys iteration", + "tasks": [ + "Dictionary.Keys sequential iteration", + "OrderedDictionary.Keys sequential iteration", + ] + }, + { + "kind": "chart", + "title": "Values iteration", + "tasks": [ + "Dictionary.Values sequential iteration", + "OrderedDictionary.Values sequential iteration", + ] + }, + { + "kind": "chart", + "title": "Values iteration", + "tasks": [ + "Dictionary.Values sequential iteration", + "OrderedDictionary.Values sequential iteration", + ] + }, + ] + }, + { + "kind": "chart", + "title": "index(forKey:)", + "tasks": [ + "Dictionary successful index(forKey:)", + "Dictionary unsuccessful index(forKey:)", + "OrderedDictionary successful index(forKey:)", + "OrderedDictionary unsuccessful index(forKey:)", + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subscript lookups", + "tasks": [ + "Dictionary subscript, successful lookups", + "Dictionary subscript, unsuccessful lookups", + "OrderedDictionary subscript, successful lookups", + "OrderedDictionary subscript, unsuccessful lookups", + ] + }, + { + "kind": "chart", + "title": "subscript setter, simple", + "tasks": [ + "Dictionary subscript, noop setter", + "Dictionary subscript, set existing", + "Dictionary subscript, _modify", + "OrderedDictionary subscript, noop setter", + "OrderedDictionary subscript, set existing", + "OrderedDictionary subscript, _modify", + ] + }, + { + "kind": "chart", + "title": "subscript insert/append", + "tasks": [ + "Dictionary subscript, insert, unique", + "Dictionary subscript, insert, reserving capacity", + "OrderedDictionary subscript, append, unique", + "OrderedDictionary subscript, append, reserving capacity", + ] + }, + { + "kind": "chart", + "title": "subscript remove", + "tasks": [ + "Dictionary subscript, remove existing, unique", + "Dictionary subscript, remove missing", + "OrderedDictionary subscript, remove existing, unique", + "OrderedDictionary subscript, remove missing", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "defaulted subscript lookups", + "tasks": [ + "Dictionary defaulted subscript, successful lookups", + "Dictionary defaulted subscript, unsuccessful lookups", + "OrderedDictionary defaulted subscript, successful lookups", + "OrderedDictionary defaulted subscript, unsuccessful lookups", + ] + }, + { + "kind": "chart", + "title": "defaulted subscript mutations", + "tasks": [ + "Dictionary defaulted subscript, _modify existing", + "Dictionary defaulted subscript, _modify missing", + "OrderedDictionary defaulted subscript, _modify existing", + "OrderedDictionary defaulted subscript, _modify missing", + ] + } + ] + }, + { + "kind": "chart", + "title": "updateValue(_:forKey:)", + "tasks": [ + "Dictionary updateValue(_:forKey:), existing", + "Dictionary updateValue(_:forKey:), insert", + "OrderedDictionary updateValue(_:forKey:), existing", + "OrderedDictionary updateValue(_:forKey:), append", + ] + } + ] + }, + { + "kind": "group", + "title": "OrderedDictionary vs std::unordered_map", + "directory": "versus STL unordered_map", + "contents": [ + { + "kind": "chart", + "title": "initializers", + "tasks": [ + "std::unordered_map insert", + "Dictionary init(uniqueKeysWithValues:)", + "OrderedDictionary init(uniqueKeysWithValues:)", + "OrderedDictionary init(uncheckedUniqueKeysWithValues:)", + "OrderedDictionary init(uncheckedUniqueKeys:values:)", + ] + }, + { + "kind": "chart", + "title": "iteration", + "tasks": [ + "std::unordered_map sequential iteration", + "Dictionary sequential iteration", + "OrderedDictionary sequential iteration", + ] + }, + { + "kind": "chart", + "title": "successful find index", + "tasks": [ + "std::unordered_map successful find", + "OrderedDictionary successful index(forKey:)", + "Dictionary successful index(forKey:)", + "Int.hashValue on each value", + ] + }, + { + "kind": "chart", + "title": "unsuccessful find index", + "tasks": [ + "std::unordered_map unsuccessful find", + "OrderedDictionary unsuccessful index(forKey:)", + "Dictionary unsuccessful index(forKey:)", + "Int.hashValue on each value", + ] + }, + { + "kind": "chart", + "title": "defaulted subscript, existing key", + "tasks": [ + "std::unordered_map subscript, existing key", + "OrderedDictionary defaulted subscript, _modify existing", + "Dictionary defaulted subscript, _modify existing", + "Int.hashValue on each value", + ] + }, + { + "kind": "chart", + "title": "defaulted subscript, new key", + "tasks": [ + "std::unordered_map subscript, new key", + "OrderedDictionary defaulted subscript, _modify missing", + "Dictionary defaulted subscript, _modify missing", + "Int.hashValue on each value", + ] + }, + { + "kind": "chart", + "title": "insert", + "tasks": [ + "std::unordered_map insert", + "OrderedDictionary subscript, append, unique", + "Dictionary subscript, insert, unique", + "Int.hashValue on each value", + ] + }, + { + "kind": "chart", + "title": "insert, reserving capacity", + "tasks": [ + "std::unordered_map insert, reserving capacity", + "OrderedDictionary subscript, append, reserving capacity", + "Dictionary subscript, insert, reserving capacity", + "Int.hashValue on each value", + ] + }, + { + "kind": "chart", + "title": "removing existing elements", + "tasks": [ + "std::unordered_map erase existing", + "OrderedDictionary subscript, remove existing, unique", + "Dictionary subscript, remove existing, unique", + ] + }, + { + "kind": "chart", + "title": "removing missing elements", + "tasks": [ + "std::unordered_map erase missing", + "OrderedDictionary subscript, remove missing", + "Dictionary subscript, remove missing", + ] + }, + ] + }, + ] +} diff --git a/Benchmarks/Libraries/OrderedSet.json b/Benchmarks/Libraries/OrderedSet.json new file mode 100644 index 00000000..e52b4a0f --- /dev/null +++ b/Benchmarks/Libraries/OrderedSet.json @@ -0,0 +1,841 @@ +{ + "kind": "group", + "title": "OrderedSet", + "directory": "OrderedSet", + "contents": [ + { + "kind": "group", + "title": "Operations", + "directory": "operations", + "contents": [ + { + "kind": "chart", + "title": "operations", + "tasks": [ + "OrderedSet init from range", + "OrderedSet init from unsafe buffer", + "OrderedSet sequential iteration", + "OrderedSet successful contains", + "OrderedSet unsuccessful contains", + "OrderedSet append", + "OrderedSet append, reserving capacity", + "OrderedSet remove", + ] + }, + { + "kind": "chart", + "title": "initializers", + "tasks": [ + "OrderedSet init from range", + "OrderedSet init from unsafe buffer", + "OrderedSet init(uncheckedUniqueElements:) from range" + ] + }, + { + "kind": "chart", + "title": "mutations", + "tasks": [ + "OrderedSet random swaps", + "OrderedSet partitioning around middle", + "OrderedSet sort", + ] + }, + { + "kind": "chart", + "title": "range replaceable", + "tasks": [ + "OrderedSet append", + "OrderedSet append, reserving capacity", + "OrderedSet prepend", + "OrderedSet prepend, reserving capacity", + "OrderedSet random insertions, reserving capacity", + "OrderedSet remove", + "OrderedSet removeLast", + "OrderedSet removeFirst", + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "union with Self", + "tasks": [ + "OrderedSet union with Self (0% overlap)", + "OrderedSet union with Self (25% overlap)", + "OrderedSet union with Self (50% overlap)", + "OrderedSet union with Self (75% overlap)", + "OrderedSet union with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "union with Array", + "tasks": [ + "OrderedSet union with Array (0% overlap)", + "OrderedSet union with Array (25% overlap)", + "OrderedSet union with Array (50% overlap)", + "OrderedSet union with Array (75% overlap)", + "OrderedSet union with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion with Self", + "tasks": [ + "OrderedSet formUnion with Self (0% overlap)", + "OrderedSet formUnion with Self (25% overlap)", + "OrderedSet formUnion with Self (50% overlap)", + "OrderedSet formUnion with Self (75% overlap)", + "OrderedSet formUnion with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion with Array", + "tasks": [ + "OrderedSet formUnion with Array (0% overlap)", + "OrderedSet formUnion with Array (25% overlap)", + "OrderedSet formUnion with Array (50% overlap)", + "OrderedSet formUnion with Array (75% overlap)", + "OrderedSet formUnion with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "intersection with Self", + "tasks": [ + "OrderedSet intersection with Self (0% overlap)", + "OrderedSet intersection with Self (25% overlap)", + "OrderedSet intersection with Self (50% overlap)", + "OrderedSet intersection with Self (75% overlap)", + "OrderedSet intersection with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection with Array", + "tasks": [ + "OrderedSet intersection with Array (0% overlap)", + "OrderedSet intersection with Array (25% overlap)", + "OrderedSet intersection with Array (50% overlap)", + "OrderedSet intersection with Array (75% overlap)", + "OrderedSet intersection with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection with Self", + "tasks": [ + "OrderedSet formIntersection with Self (0% overlap)", + "OrderedSet formIntersection with Self (25% overlap)", + "OrderedSet formIntersection with Self (50% overlap)", + "OrderedSet formIntersection with Self (75% overlap)", + "OrderedSet formIntersection with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection with Array", + "tasks": [ + "OrderedSet formIntersection with Array (0% overlap)", + "OrderedSet formIntersection with Array (25% overlap)", + "OrderedSet formIntersection with Array (50% overlap)", + "OrderedSet formIntersection with Array (75% overlap)", + "OrderedSet formIntersection with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "symmetricDifference with Self", + "tasks": [ + "OrderedSet symmetricDifference with Self (0% overlap)", + "OrderedSet symmetricDifference with Self (25% overlap)", + "OrderedSet symmetricDifference with Self (50% overlap)", + "OrderedSet symmetricDifference with Self (75% overlap)", + "OrderedSet symmetricDifference with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference with Array", + "tasks": [ + "OrderedSet symmetricDifference with Array (0% overlap)", + "OrderedSet symmetricDifference with Array (25% overlap)", + "OrderedSet symmetricDifference with Array (50% overlap)", + "OrderedSet symmetricDifference with Array (75% overlap)", + "OrderedSet symmetricDifference with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference with Self", + "tasks": [ + "OrderedSet formSymmetricDifference with Self (0% overlap)", + "OrderedSet formSymmetricDifference with Self (25% overlap)", + "OrderedSet formSymmetricDifference with Self (50% overlap)", + "OrderedSet formSymmetricDifference with Self (75% overlap)", + "OrderedSet formSymmetricDifference with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference with Array", + "tasks": [ + "OrderedSet formSymmetricDifference with Array (0% overlap)", + "OrderedSet formSymmetricDifference with Array (25% overlap)", + "OrderedSet formSymmetricDifference with Array (50% overlap)", + "OrderedSet formSymmetricDifference with Array (75% overlap)", + "OrderedSet formSymmetricDifference with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subtracting Self", + "tasks": [ + "OrderedSet subtracting Self (0% overlap)", + "OrderedSet subtracting Self (25% overlap)", + "OrderedSet subtracting Self (50% overlap)", + "OrderedSet subtracting Self (75% overlap)", + "OrderedSet subtracting Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting Array", + "tasks": [ + "OrderedSet subtracting Array (0% overlap)", + "OrderedSet subtracting Array (25% overlap)", + "OrderedSet subtracting Array (50% overlap)", + "OrderedSet subtracting Array (75% overlap)", + "OrderedSet subtracting Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract Self", + "tasks": [ + "OrderedSet subtract Self (0% overlap)", + "OrderedSet subtract Self (25% overlap)", + "OrderedSet subtract Self (50% overlap)", + "OrderedSet subtract Self (75% overlap)", + "OrderedSet subtract Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract with Array", + "tasks": [ + "OrderedSet subtract Array (0% overlap)", + "OrderedSet subtract Array (25% overlap)", + "OrderedSet subtract Array (50% overlap)", + "OrderedSet subtract Array (75% overlap)", + "OrderedSet subtract Array (100% overlap)", + ] + }, + ] + }, + ] + }, + { + "kind": "group", + "title": "OrderedSet vs Set", + "directory": "versus Set", + "contents": [ + { + "kind": "chart", + "title": "init from buffer of integers", + "tasks": [ + "OrderedSet init from unsafe buffer", + "Set init from unsafe buffer", + ] + }, + { + "kind": "chart", + "title": "init from range of integers", + "tasks": [ + "OrderedSet init from range", + "Set init from range", + ] + }, + { + "kind": "chart", + "title": "sequential iteration", + "tasks": [ + "OrderedSet sequential iteration", + "Set sequential iteration", + ] + }, + { + "kind": "chart", + "title": "successful random lookups", + "tasks": [ + "OrderedSet successful contains", + "Set successful contains", + ] + }, + { + "kind": "chart", + "title": "unsuccessful random lookups", + "tasks": [ + "OrderedSet unsuccessful contains", + "Set unsuccessful contains", + ] + }, + { + "kind": "chart", + "title": "insert", + "tasks": [ + "OrderedSet append", + "OrderedSet append, reserving capacity", + "Set insert", + "Set insert, reserving capacity", + ] + }, + { + "kind": "chart", + "title": "remove", + "tasks": [ + "OrderedSet remove", + "Set remove", + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "union (0% overlap)", + "tasks": [ + "OrderedSet union with Self (0% overlap)", + "OrderedSet union with Array (0% overlap)", + "Set union with Self (0% overlap)", + "Set union with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (25% overlap)", + "tasks": [ + "OrderedSet union with Self (25% overlap)", + "OrderedSet union with Array (25% overlap)", + "Set union with Self (25% overlap)", + "Set union with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (50% overlap)", + "tasks": [ + "OrderedSet union with Self (50% overlap)", + "OrderedSet union with Array (50% overlap)", + "Set union with Self (50% overlap)", + "Set union with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (75% overlap)", + "tasks": [ + "OrderedSet union with Self (75% overlap)", + "OrderedSet union with Array (75% overlap)", + "Set union with Self (75% overlap)", + "Set union with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (100% overlap)", + "tasks": [ + "OrderedSet union with Self (100% overlap)", + "OrderedSet union with Array (100% overlap)", + "Set union with Self (100% overlap)", + "Set union with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "formUnion (0% overlap)", + "tasks": [ + "OrderedSet formUnion with Self (0% overlap)", + "OrderedSet formUnion with Array (0% overlap)", + "Set formUnion with Self (0% overlap)", + "Set formUnion with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (25% overlap)", + "tasks": [ + "OrderedSet formUnion with Self (25% overlap)", + "OrderedSet formUnion with Array (25% overlap)", + "Set formUnion with Self (25% overlap)", + "Set formUnion with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (50% overlap)", + "tasks": [ + "OrderedSet formUnion with Self (50% overlap)", + "OrderedSet formUnion with Array (50% overlap)", + "Set formUnion with Self (50% overlap)", + "Set formUnion with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (75% overlap)", + "tasks": [ + "OrderedSet formUnion with Self (75% overlap)", + "OrderedSet formUnion with Array (75% overlap)", + "Set formUnion with Self (75% overlap)", + "Set formUnion with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (100% overlap)", + "tasks": [ + "OrderedSet formUnion with Self (100% overlap)", + "OrderedSet formUnion with Array (100% overlap)", + "Set formUnion with Self (100% overlap)", + "Set formUnion with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "intersection (0% overlap)", + "tasks": [ + "OrderedSet intersection with Self (0% overlap)", + "OrderedSet intersection with Array (0% overlap)", + "Set intersection with Self (0% overlap)", + "Set intersection with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (25% overlap)", + "tasks": [ + "OrderedSet intersection with Self (25% overlap)", + "OrderedSet intersection with Array (25% overlap)", + "Set intersection with Self (25% overlap)", + "Set intersection with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (50% overlap)", + "tasks": [ + "OrderedSet intersection with Self (50% overlap)", + "OrderedSet intersection with Array (50% overlap)", + "Set intersection with Self (50% overlap)", + "Set intersection with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (75% overlap)", + "tasks": [ + "OrderedSet intersection with Self (75% overlap)", + "OrderedSet intersection with Array (75% overlap)", + "Set intersection with Self (75% overlap)", + "Set intersection with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (100% overlap)", + "tasks": [ + "OrderedSet intersection with Self (100% overlap)", + "OrderedSet intersection with Array (100% overlap)", + "Set intersection with Self (100% overlap)", + "Set intersection with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "formIntersection (0% overlap)", + "tasks": [ + "OrderedSet formIntersection with Self (0% overlap)", + "OrderedSet formIntersection with Array (0% overlap)", + "Set formIntersection with Self (0% overlap)", + "Set formIntersection with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (25% overlap)", + "tasks": [ + "OrderedSet formIntersection with Self (25% overlap)", + "OrderedSet formIntersection with Array (25% overlap)", + "Set formIntersection with Self (25% overlap)", + "Set formIntersection with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (50% overlap)", + "tasks": [ + "OrderedSet formIntersection with Self (50% overlap)", + "OrderedSet formIntersection with Array (50% overlap)", + "Set formIntersection with Self (50% overlap)", + "Set formIntersection with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (75% overlap)", + "tasks": [ + "OrderedSet formIntersection with Self (75% overlap)", + "OrderedSet formIntersection with Array (75% overlap)", + "Set formIntersection with Self (75% overlap)", + "Set formIntersection with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (100% overlap)", + "tasks": [ + "OrderedSet formIntersection with Self (100% overlap)", + "OrderedSet formIntersection with Array (100% overlap)", + "Set formIntersection with Self (100% overlap)", + "Set formIntersection with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "symmetricDifference (0% overlap)", + "tasks": [ + "OrderedSet symmetricDifference with Self (0% overlap)", + "OrderedSet symmetricDifference with Array (0% overlap)", + "Set symmetricDifference with Self (0% overlap)", + "Set symmetricDifference with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (25% overlap)", + "tasks": [ + "OrderedSet symmetricDifference with Self (25% overlap)", + "OrderedSet symmetricDifference with Array (25% overlap)", + "Set symmetricDifference with Self (25% overlap)", + "Set symmetricDifference with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (50% overlap)", + "tasks": [ + "OrderedSet symmetricDifference with Self (50% overlap)", + "OrderedSet symmetricDifference with Array (50% overlap)", + "Set symmetricDifference with Self (50% overlap)", + "Set symmetricDifference with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (75% overlap)", + "tasks": [ + "OrderedSet symmetricDifference with Self (75% overlap)", + "OrderedSet symmetricDifference with Array (75% overlap)", + "Set symmetricDifference with Self (75% overlap)", + "Set symmetricDifference with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (100% overlap)", + "tasks": [ + "OrderedSet symmetricDifference with Self (100% overlap)", + "OrderedSet symmetricDifference with Array (100% overlap)", + "Set symmetricDifference with Self (100% overlap)", + "Set symmetricDifference with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "formSymmetricDifference (0% overlap)", + "tasks": [ + "OrderedSet formSymmetricDifference with Self (0% overlap)", + "OrderedSet formSymmetricDifference with Array (0% overlap)", + "Set formSymmetricDifference with Self (0% overlap)", + "Set formSymmetricDifference with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (25% overlap)", + "tasks": [ + "OrderedSet formSymmetricDifference with Self (25% overlap)", + "OrderedSet formSymmetricDifference with Array (25% overlap)", + "Set formSymmetricDifference with Self (25% overlap)", + "Set formSymmetricDifference with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (50% overlap)", + "tasks": [ + "OrderedSet formSymmetricDifference with Self (50% overlap)", + "OrderedSet formSymmetricDifference with Array (50% overlap)", + "Set formSymmetricDifference with Self (50% overlap)", + "Set formSymmetricDifference with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (75% overlap)", + "tasks": [ + "OrderedSet formSymmetricDifference with Self (75% overlap)", + "OrderedSet formSymmetricDifference with Array (75% overlap)", + "Set formSymmetricDifference with Self (75% overlap)", + "Set formSymmetricDifference with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (100% overlap)", + "tasks": [ + "OrderedSet formSymmetricDifference with Self (100% overlap)", + "OrderedSet formSymmetricDifference with Array (100% overlap)", + "Set formSymmetricDifference with Self (100% overlap)", + "Set formSymmetricDifference with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subtracting (0% overlap)", + "tasks": [ + "OrderedSet subtracting Self (0% overlap)", + "OrderedSet subtracting Array (0% overlap)", + "Set subtracting Self (0% overlap)", + "Set subtracting Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (25% overlap)", + "tasks": [ + "OrderedSet subtracting Self (25% overlap)", + "OrderedSet subtracting Array (25% overlap)", + "Set subtracting Self (25% overlap)", + "Set subtracting Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (50% overlap)", + "tasks": [ + "OrderedSet subtracting Self (50% overlap)", + "OrderedSet subtracting Array (50% overlap)", + "Set subtracting Self (50% overlap)", + "Set subtracting Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (75% overlap)", + "tasks": [ + "OrderedSet subtracting Self (75% overlap)", + "OrderedSet subtracting Array (75% overlap)", + "Set subtracting Self (75% overlap)", + "Set subtracting Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (100% overlap)", + "tasks": [ + "OrderedSet subtracting Self (100% overlap)", + "OrderedSet subtracting Array (100% overlap)", + "Set subtracting Self (100% overlap)", + "Set subtracting Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subtract (0% overlap)", + "tasks": [ + "OrderedSet subtract Self (0% overlap)", + "OrderedSet subtract Array (0% overlap)", + "Set subtract Self (0% overlap)", + "Set subtract Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (25% overlap)", + "tasks": [ + "OrderedSet subtract Self (25% overlap)", + "OrderedSet subtract Array (25% overlap)", + "Set subtract Self (25% overlap)", + "Set subtract Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (50% overlap)", + "tasks": [ + "OrderedSet subtract Self (50% overlap)", + "OrderedSet subtract Array (50% overlap)", + "Set subtract Self (50% overlap)", + "Set subtract Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (75% overlap)", + "tasks": [ + "OrderedSet subtract Self (75% overlap)", + "OrderedSet subtract Array (75% overlap)", + "Set subtract Self (75% overlap)", + "Set subtract Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (100% overlap)", + "tasks": [ + "OrderedSet subtract Self (100% overlap)", + "OrderedSet subtract Array (100% overlap)", + "Set subtract Self (100% overlap)", + "Set subtract Array (100% overlap)", + ] + }, + ] + }, + ] + }, + { + "kind": "group", + "title": "OrderedSet vs std::unordered_set", + "directory": "versus STL unordered_set", + "contents": [ + { + "kind": "chart", + "title": "init from integer range", + "tasks": [ + "std::unordered_set insert from integer range", + "Set init from range", + "OrderedSet init from range", + ] + }, + { + "kind": "chart", + "title": "init from buffer of integers", + "tasks": [ + "std::unordered_set constructor from buffer", + "Set init from unsafe buffer", + "OrderedSet init from unsafe buffer", + ] + }, + { + "kind": "chart", + "title": "sequential iteration", + "tasks": [ + "std::unordered_set sequential iteration", + "Set sequential iteration", + "OrderedSet sequential iteration", + ] + }, + { + "kind": "chart", + "title": "successful lookups", + "tasks": [ + "std::unordered_set successful find", + "OrderedSet successful contains", + "Set successful contains", + ] + }, + { + "kind": "chart", + "title": "unsuccessful lookups", + "tasks": [ + "std::unordered_set unsuccessful find", + "OrderedSet unsuccessful contains", + "Set unsuccessful contains", + ] + }, + { + "kind": "chart", + "title": "insertions", + "tasks": [ + "std::unordered_set insert", + "Set insert", + "OrderedSet append", + ] + }, + { + "kind": "chart", + "title": "insertions, reserving capacity", + "tasks": [ + "std::unordered_set insert, reserving capacity", + "Set insert, reserving capacity", + "OrderedSet append, reserving capacity", + ] + }, + { + "kind": "chart", + "title": "random removals", + "tasks": [ + "std::unordered_set erase", + "Set remove", + "OrderedSet remove", + ] + }, + ] + }, + + ] +} diff --git a/Benchmarks/Libraries/Set.json b/Benchmarks/Libraries/Set.json new file mode 100644 index 00000000..0322122d --- /dev/null +++ b/Benchmarks/Libraries/Set.json @@ -0,0 +1,299 @@ +{ + "kind": "group", + "title": "Set Benchmarks", + "directory": "Set", + "contents": [ + { + "kind": "group", + "title": "Operations", + "directory": "operations", + "contents": [ + { + "kind": "chart", + "title": "operations", + "tasks": [ + "Set init from range", + "Set init from unsafe buffer", + "Set sequential iteration", + "Set successful contains", + "Set unsuccessful contains", + "Set insert", + "Set insert, reserving capacity", + "Set remove" + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "union with Self", + "tasks": [ + "Set union with Self (0% overlap)", + "Set union with Self (25% overlap)", + "Set union with Self (50% overlap)", + "Set union with Self (75% overlap)", + "Set union with Self (100% overlap)" + ] + }, + { + "kind": "chart", + "title": "union with Array", + "tasks": [ + "Set union with Array (0% overlap)", + "Set union with Array (25% overlap)", + "Set union with Array (50% overlap)", + "Set union with Array (75% overlap)", + "Set union with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion with Self", + "tasks": [ + "Set formUnion with Self (0% overlap)", + "Set formUnion with Self (25% overlap)", + "Set formUnion with Self (50% overlap)", + "Set formUnion with Self (75% overlap)", + "Set formUnion with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion with Array", + "tasks": [ + "Set formUnion with Array (0% overlap)", + "Set formUnion with Array (25% overlap)", + "Set formUnion with Array (50% overlap)", + "Set formUnion with Array (75% overlap)", + "Set formUnion with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "intersection with Self", + "tasks": [ + "Set intersection with Self (0% overlap)", + "Set intersection with Self (25% overlap)", + "Set intersection with Self (50% overlap)", + "Set intersection with Self (75% overlap)", + "Set intersection with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection with Array", + "tasks": [ + "Set intersection with Array (0% overlap)", + "Set intersection with Array (25% overlap)", + "Set intersection with Array (50% overlap)", + "Set intersection with Array (75% overlap)", + "Set intersection with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection with Self", + "tasks": [ + "Set formIntersection with Self (0% overlap)", + "Set formIntersection with Self (25% overlap)", + "Set formIntersection with Self (50% overlap)", + "Set formIntersection with Self (75% overlap)", + "Set formIntersection with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection with Array", + "tasks": [ + "Set formIntersection with Array (0% overlap)", + "Set formIntersection with Array (25% overlap)", + "Set formIntersection with Array (50% overlap)", + "Set formIntersection with Array (75% overlap)", + "Set formIntersection with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "symmetricDifference with Self", + "tasks": [ + "Set symmetricDifference with Self (0% overlap)", + "Set symmetricDifference with Self (25% overlap)", + "Set symmetricDifference with Self (50% overlap)", + "Set symmetricDifference with Self (75% overlap)", + "Set symmetricDifference with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference with Array", + "tasks": [ + "Set symmetricDifference with Array (0% overlap)", + "Set symmetricDifference with Array (25% overlap)", + "Set symmetricDifference with Array (50% overlap)", + "Set symmetricDifference with Array (75% overlap)", + "Set symmetricDifference with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference with Self", + "tasks": [ + "Set formSymmetricDifference with Self (0% overlap)", + "Set formSymmetricDifference with Self (25% overlap)", + "Set formSymmetricDifference with Self (50% overlap)", + "Set formSymmetricDifference with Self (75% overlap)", + "Set formSymmetricDifference with Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference with Array", + "tasks": [ + "Set formSymmetricDifference with Array (0% overlap)", + "Set formSymmetricDifference with Array (25% overlap)", + "Set formSymmetricDifference with Array (50% overlap)", + "Set formSymmetricDifference with Array (75% overlap)", + "Set formSymmetricDifference with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subtracting Self", + "tasks": [ + "Set subtracting Self (0% overlap)", + "Set subtracting Self (25% overlap)", + "Set subtracting Self (50% overlap)", + "Set subtracting Self (75% overlap)", + "Set subtracting Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting Array", + "tasks": [ + "Set subtracting Array (0% overlap)", + "Set subtracting Array (25% overlap)", + "Set subtracting Array (50% overlap)", + "Set subtracting Array (75% overlap)", + "Set subtracting Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract Self", + "tasks": [ + "Set subtract Self (0% overlap)", + "Set subtract Self (25% overlap)", + "Set subtract Self (50% overlap)", + "Set subtract Self (75% overlap)", + "Set subtract Self (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract with Array", + "tasks": [ + "Set subtract Array (0% overlap)", + "Set subtract Array (25% overlap)", + "Set subtract Array (50% overlap)", + "Set subtract Array (75% overlap)", + "Set subtract Array (100% overlap)", + ] + }, + ] + }, + ] + }, + { + "kind": "group", + "title": "Set vs std::unordered_set", + "directory": "versus STL unordered_set", + "contents": [ + { + "kind": "chart", + "title": "Hashing", + "tasks": [ + "std::hash", + "custom_intptr_hash (using Swift.Hasher)", + "Hasher.combine on a single buffer of integers", + "Int.hashValue on each value", + ] + }, + { + "kind": "chart", + "title": "init from integer range", + "tasks": [ + "std::unordered_set insert from integer range", + "Set init from range", + ] + }, + { + "kind": "chart", + "title": "init from buffer of integers", + "tasks": [ + "std::unordered_set constructor from buffer", + "Set init from unsafe buffer", + ] + }, + { + "kind": "chart", + "title": "sequential iteration", + "tasks": [ + "std::unordered_set sequential iteration", + "Set sequential iteration", + ] + }, + { + "kind": "chart", + "title": "successful lookups", + "tasks": [ + "std::unordered_set successful find", + "Set successful contains", + ] + }, + { + "kind": "chart", + "title": "unsuccessful lookups", + "tasks": [ + "std::unordered_set unsuccessful find", + "Set unsuccessful contains", + ] + }, + { + "kind": "chart", + "title": "random insertions", + "tasks": [ + "std::unordered_set insert", + "std::unordered_set insert, reserving capacity", + "Set insert", + "Set insert, reserving capacity", + ] + }, + { + "kind": "chart", + "title": "random removals", + "tasks": [ + "std::unordered_set erase", + "Set remove", + ] + }, + ] + } + ] +} diff --git a/Benchmarks/Libraries/ShareableDictionary.json b/Benchmarks/Libraries/ShareableDictionary.json index a568e0fd..6ba966d1 100644 --- a/Benchmarks/Libraries/ShareableDictionary.json +++ b/Benchmarks/Libraries/ShareableDictionary.json @@ -1,7 +1,7 @@ { "kind": "group", "title": "ShareableDictionary Benchmarks", - "directory": "Results", + "directory": "ShareableDictionary", "contents": [ { "kind": "group", diff --git a/Benchmarks/Libraries/ShareableSet.json b/Benchmarks/Libraries/ShareableSet.json index aa84b21f..6e09ca2d 100644 --- a/Benchmarks/Libraries/ShareableSet.json +++ b/Benchmarks/Libraries/ShareableSet.json @@ -1,882 +1,889 @@ { - "kind": "group", - "title": "ShareableSet Benchmarks", - "directory": "Results", - "contents": [ + "kind": "group", + "title": "ShareableSet Benchmarks", + "directory": "ShareableSet", + "contents": [ + { + "kind": "group", + "title": "Operations", + "directory": "operations", + "contents": [ { - "kind": "chart", - "title": "operations", - "tasks": [ - "ShareableSet init from range", - "ShareableSet init from unsafe buffer", - "ShareableSet sequential iteration", - "ShareableSet successful contains", - "ShareableSet unsuccessful contains", - "ShareableSet insert", - "ShareableSet remove" - ] + "kind": "chart", + "title": "operations", + "tasks": [ + "ShareableSet init from range", + "ShareableSet init from unsafe buffer", + "ShareableSet sequential iteration", + "ShareableSet successful contains", + "ShareableSet unsuccessful contains", + "ShareableSet insert", + "ShareableSet remove" + ] }, { - "kind": "chart", - "title": "initializers", - "tasks": [ - "ShareableSet init from range", - "ShareableSet init from unsafe buffer", - ] + "kind": "chart", + "title": "initializers", + "tasks": [ + "ShareableSet init from range", + "ShareableSet init from unsafe buffer", + ] }, { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "union with Self, distinct", - "tasks": [ - "ShareableSet union with Self (0% overlap, distinct)", - "ShareableSet union with Self (25% overlap, distinct)", - "ShareableSet union with Self (50% overlap, distinct)", - "ShareableSet union with Self (75% overlap, distinct)", - "ShareableSet union with Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "union with Self, shared", - "tasks": [ - "ShareableSet union with Self (0% overlap, shared)", - "ShareableSet union with Self (25% overlap, shared)", - "ShareableSet union with Self (50% overlap, shared)", - "ShareableSet union with Self (75% overlap, shared)", - "ShareableSet union with Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "union with Array", - "tasks": [ - "ShareableSet union with Array (0% overlap)", - "ShareableSet union with Array (25% overlap)", - "ShareableSet union with Array (50% overlap)", - "ShareableSet union with Array (75% overlap)", - "ShareableSet union with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion with Self, distinct", - "tasks": [ - "ShareableSet formUnion with Self (0% overlap, distinct)", - "ShareableSet formUnion with Self (25% overlap, distinct)", - "ShareableSet formUnion with Self (50% overlap, distinct)", - "ShareableSet formUnion with Self (75% overlap, distinct)", - "ShareableSet formUnion with Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "formUnion with Self, shared", - "tasks": [ - "ShareableSet formUnion with Self (0% overlap, shared)", - "ShareableSet formUnion with Self (25% overlap, shared)", - "ShareableSet formUnion with Self (50% overlap, shared)", - "ShareableSet formUnion with Self (75% overlap, shared)", - "ShareableSet formUnion with Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "formUnion with Array", - "tasks": [ - "ShareableSet formUnion with Array (0% overlap)", - "ShareableSet formUnion with Array (25% overlap)", - "ShareableSet formUnion with Array (50% overlap)", - "ShareableSet formUnion with Array (75% overlap)", - "ShareableSet formUnion with Array (100% overlap)", - ] - }, - ] + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "union with Self, distinct", + "tasks": [ + "ShareableSet union with Self (0% overlap, distinct)", + "ShareableSet union with Self (25% overlap, distinct)", + "ShareableSet union with Self (50% overlap, distinct)", + "ShareableSet union with Self (75% overlap, distinct)", + "ShareableSet union with Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "union with Self, shared", + "tasks": [ + "ShareableSet union with Self (0% overlap, shared)", + "ShareableSet union with Self (25% overlap, shared)", + "ShareableSet union with Self (50% overlap, shared)", + "ShareableSet union with Self (75% overlap, shared)", + "ShareableSet union with Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "union with Array", + "tasks": [ + "ShareableSet union with Array (0% overlap)", + "ShareableSet union with Array (25% overlap)", + "ShareableSet union with Array (50% overlap)", + "ShareableSet union with Array (75% overlap)", + "ShareableSet union with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion with Self, distinct", + "tasks": [ + "ShareableSet formUnion with Self (0% overlap, distinct)", + "ShareableSet formUnion with Self (25% overlap, distinct)", + "ShareableSet formUnion with Self (50% overlap, distinct)", + "ShareableSet formUnion with Self (75% overlap, distinct)", + "ShareableSet formUnion with Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "formUnion with Self, shared", + "tasks": [ + "ShareableSet formUnion with Self (0% overlap, shared)", + "ShareableSet formUnion with Self (25% overlap, shared)", + "ShareableSet formUnion with Self (50% overlap, shared)", + "ShareableSet formUnion with Self (75% overlap, shared)", + "ShareableSet formUnion with Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "formUnion with Array", + "tasks": [ + "ShareableSet formUnion with Array (0% overlap)", + "ShareableSet formUnion with Array (25% overlap)", + "ShareableSet formUnion with Array (50% overlap)", + "ShareableSet formUnion with Array (75% overlap)", + "ShareableSet formUnion with Array (100% overlap)", + ] + }, + ] }, { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "intersection with Self, distinct", - "tasks": [ - "ShareableSet intersection with Self (0% overlap, distinct)", - "ShareableSet intersection with Self (25% overlap, distinct)", - "ShareableSet intersection with Self (50% overlap, distinct)", - "ShareableSet intersection with Self (75% overlap, distinct)", - "ShareableSet intersection with Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "intersection with Self, shared", - "tasks": [ - "ShareableSet intersection with Self (0% overlap, shared)", - "ShareableSet intersection with Self (25% overlap, shared)", - "ShareableSet intersection with Self (50% overlap, shared)", - "ShareableSet intersection with Self (75% overlap, shared)", - "ShareableSet intersection with Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "intersection with Array", - "tasks": [ - "ShareableSet intersection with Array (0% overlap)", - "ShareableSet intersection with Array (25% overlap)", - "ShareableSet intersection with Array (50% overlap)", - "ShareableSet intersection with Array (75% overlap)", - "ShareableSet intersection with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection with Self, distinct", - "tasks": [ - "ShareableSet formIntersection with Self (0% overlap, distinct)", - "ShareableSet formIntersection with Self (25% overlap, distinct)", - "ShareableSet formIntersection with Self (50% overlap, distinct)", - "ShareableSet formIntersection with Self (75% overlap, distinct)", - "ShareableSet formIntersection with Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "formIntersection with Self, shared", - "tasks": [ - "ShareableSet formIntersection with Self (0% overlap, shared)", - "ShareableSet formIntersection with Self (25% overlap, shared)", - "ShareableSet formIntersection with Self (50% overlap, shared)", - "ShareableSet formIntersection with Self (75% overlap, shared)", - "ShareableSet formIntersection with Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "formIntersection with Array", - "tasks": [ - "ShareableSet formIntersection with Array (0% overlap)", - "ShareableSet formIntersection with Array (25% overlap)", - "ShareableSet formIntersection with Array (50% overlap)", - "ShareableSet formIntersection with Array (75% overlap)", - "ShareableSet formIntersection with Array (100% overlap)", - ] - }, - ] + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "intersection with Self, distinct", + "tasks": [ + "ShareableSet intersection with Self (0% overlap, distinct)", + "ShareableSet intersection with Self (25% overlap, distinct)", + "ShareableSet intersection with Self (50% overlap, distinct)", + "ShareableSet intersection with Self (75% overlap, distinct)", + "ShareableSet intersection with Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "intersection with Self, shared", + "tasks": [ + "ShareableSet intersection with Self (0% overlap, shared)", + "ShareableSet intersection with Self (25% overlap, shared)", + "ShareableSet intersection with Self (50% overlap, shared)", + "ShareableSet intersection with Self (75% overlap, shared)", + "ShareableSet intersection with Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "intersection with Array", + "tasks": [ + "ShareableSet intersection with Array (0% overlap)", + "ShareableSet intersection with Array (25% overlap)", + "ShareableSet intersection with Array (50% overlap)", + "ShareableSet intersection with Array (75% overlap)", + "ShareableSet intersection with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection with Self, distinct", + "tasks": [ + "ShareableSet formIntersection with Self (0% overlap, distinct)", + "ShareableSet formIntersection with Self (25% overlap, distinct)", + "ShareableSet formIntersection with Self (50% overlap, distinct)", + "ShareableSet formIntersection with Self (75% overlap, distinct)", + "ShareableSet formIntersection with Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "formIntersection with Self, shared", + "tasks": [ + "ShareableSet formIntersection with Self (0% overlap, shared)", + "ShareableSet formIntersection with Self (25% overlap, shared)", + "ShareableSet formIntersection with Self (50% overlap, shared)", + "ShareableSet formIntersection with Self (75% overlap, shared)", + "ShareableSet formIntersection with Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "formIntersection with Array", + "tasks": [ + "ShareableSet formIntersection with Array (0% overlap)", + "ShareableSet formIntersection with Array (25% overlap)", + "ShareableSet formIntersection with Array (50% overlap)", + "ShareableSet formIntersection with Array (75% overlap)", + "ShareableSet formIntersection with Array (100% overlap)", + ] + }, + ] }, { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "symmetricDifference with Self, distinct", - "tasks": [ - "ShareableSet symmetricDifference with Self (0% overlap, distinct)", - "ShareableSet symmetricDifference with Self (25% overlap, distinct)", - "ShareableSet symmetricDifference with Self (50% overlap, distinct)", - "ShareableSet symmetricDifference with Self (75% overlap, distinct)", - "ShareableSet symmetricDifference with Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference with Self, shared", - "tasks": [ - "ShareableSet symmetricDifference with Self (0% overlap, shared)", - "ShareableSet symmetricDifference with Self (25% overlap, shared)", - "ShareableSet symmetricDifference with Self (50% overlap, shared)", - "ShareableSet symmetricDifference with Self (75% overlap, shared)", - "ShareableSet symmetricDifference with Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference with Array", - "tasks": [ - "ShareableSet symmetricDifference with Array (0% overlap)", - "ShareableSet symmetricDifference with Array (25% overlap)", - "ShareableSet symmetricDifference with Array (50% overlap)", - "ShareableSet symmetricDifference with Array (75% overlap)", - "ShareableSet symmetricDifference with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference with Self, distinct", - "tasks": [ - "ShareableSet formSymmetricDifference with Self (0% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (25% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (50% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (75% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference with Self, shared", - "tasks": [ - "ShareableSet formSymmetricDifference with Self (0% overlap, shared)", - "ShareableSet formSymmetricDifference with Self (25% overlap, shared)", - "ShareableSet formSymmetricDifference with Self (50% overlap, shared)", - "ShareableSet formSymmetricDifference with Self (75% overlap, shared)", - "ShareableSet formSymmetricDifference with Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference with Array", - "tasks": [ - "ShareableSet formSymmetricDifference with Array (0% overlap)", - "ShareableSet formSymmetricDifference with Array (25% overlap)", - "ShareableSet formSymmetricDifference with Array (50% overlap)", - "ShareableSet formSymmetricDifference with Array (75% overlap)", - "ShareableSet formSymmetricDifference with Array (100% overlap)", - ] - }, - ] + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "symmetricDifference with Self, distinct", + "tasks": [ + "ShareableSet symmetricDifference with Self (0% overlap, distinct)", + "ShareableSet symmetricDifference with Self (25% overlap, distinct)", + "ShareableSet symmetricDifference with Self (50% overlap, distinct)", + "ShareableSet symmetricDifference with Self (75% overlap, distinct)", + "ShareableSet symmetricDifference with Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference with Self, shared", + "tasks": [ + "ShareableSet symmetricDifference with Self (0% overlap, shared)", + "ShareableSet symmetricDifference with Self (25% overlap, shared)", + "ShareableSet symmetricDifference with Self (50% overlap, shared)", + "ShareableSet symmetricDifference with Self (75% overlap, shared)", + "ShareableSet symmetricDifference with Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference with Array", + "tasks": [ + "ShareableSet symmetricDifference with Array (0% overlap)", + "ShareableSet symmetricDifference with Array (25% overlap)", + "ShareableSet symmetricDifference with Array (50% overlap)", + "ShareableSet symmetricDifference with Array (75% overlap)", + "ShareableSet symmetricDifference with Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference with Self, distinct", + "tasks": [ + "ShareableSet formSymmetricDifference with Self (0% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (25% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (50% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (75% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference with Self, shared", + "tasks": [ + "ShareableSet formSymmetricDifference with Self (0% overlap, shared)", + "ShareableSet formSymmetricDifference with Self (25% overlap, shared)", + "ShareableSet formSymmetricDifference with Self (50% overlap, shared)", + "ShareableSet formSymmetricDifference with Self (75% overlap, shared)", + "ShareableSet formSymmetricDifference with Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference with Array", + "tasks": [ + "ShareableSet formSymmetricDifference with Array (0% overlap)", + "ShareableSet formSymmetricDifference with Array (25% overlap)", + "ShareableSet formSymmetricDifference with Array (50% overlap)", + "ShareableSet formSymmetricDifference with Array (75% overlap)", + "ShareableSet formSymmetricDifference with Array (100% overlap)", + ] + }, + ] }, { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subtracting Self, distinct", - "tasks": [ - "ShareableSet subtracting Self (0% overlap, distinct)", - "ShareableSet subtracting Self (25% overlap, distinct)", - "ShareableSet subtracting Self (50% overlap, distinct)", - "ShareableSet subtracting Self (75% overlap, distinct)", - "ShareableSet subtracting Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "subtracting Self, shared", - "tasks": [ - "ShareableSet subtracting Self (0% overlap, shared)", - "ShareableSet subtracting Self (25% overlap, shared)", - "ShareableSet subtracting Self (50% overlap, shared)", - "ShareableSet subtracting Self (75% overlap, shared)", - "ShareableSet subtracting Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "subtracting Array", - "tasks": [ - "ShareableSet subtracting Array (0% overlap)", - "ShareableSet subtracting Array (25% overlap)", - "ShareableSet subtracting Array (50% overlap)", - "ShareableSet subtracting Array (75% overlap)", - "ShareableSet subtracting Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract Self, distinct", - "tasks": [ - "ShareableSet subtract Self (0% overlap, distinct)", - "ShareableSet subtract Self (25% overlap, distinct)", - "ShareableSet subtract Self (50% overlap, distinct)", - "ShareableSet subtract Self (75% overlap, distinct)", - "ShareableSet subtract Self (100% overlap, distinct)", - ] - }, - { - "kind": "chart", - "title": "subtract Self, shared", - "tasks": [ - "ShareableSet subtract Self (0% overlap, shared)", - "ShareableSet subtract Self (25% overlap, shared)", - "ShareableSet subtract Self (50% overlap, shared)", - "ShareableSet subtract Self (75% overlap, shared)", - "ShareableSet subtract Self (100% overlap, shared)", - ] - }, - { - "kind": "chart", - "title": "subtract with Array", - "tasks": [ - "ShareableSet subtract Array (0% overlap)", - "ShareableSet subtract Array (25% overlap)", - "ShareableSet subtract Array (50% overlap)", - "ShareableSet subtract Array (75% overlap)", - "ShareableSet subtract Array (100% overlap)", - ] - }, - ] + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subtracting Self, distinct", + "tasks": [ + "ShareableSet subtracting Self (0% overlap, distinct)", + "ShareableSet subtracting Self (25% overlap, distinct)", + "ShareableSet subtracting Self (50% overlap, distinct)", + "ShareableSet subtracting Self (75% overlap, distinct)", + "ShareableSet subtracting Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "subtracting Self, shared", + "tasks": [ + "ShareableSet subtracting Self (0% overlap, shared)", + "ShareableSet subtracting Self (25% overlap, shared)", + "ShareableSet subtracting Self (50% overlap, shared)", + "ShareableSet subtracting Self (75% overlap, shared)", + "ShareableSet subtracting Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "subtracting Array", + "tasks": [ + "ShareableSet subtracting Array (0% overlap)", + "ShareableSet subtracting Array (25% overlap)", + "ShareableSet subtracting Array (50% overlap)", + "ShareableSet subtracting Array (75% overlap)", + "ShareableSet subtracting Array (100% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract Self, distinct", + "tasks": [ + "ShareableSet subtract Self (0% overlap, distinct)", + "ShareableSet subtract Self (25% overlap, distinct)", + "ShareableSet subtract Self (50% overlap, distinct)", + "ShareableSet subtract Self (75% overlap, distinct)", + "ShareableSet subtract Self (100% overlap, distinct)", + ] + }, + { + "kind": "chart", + "title": "subtract Self, shared", + "tasks": [ + "ShareableSet subtract Self (0% overlap, shared)", + "ShareableSet subtract Self (25% overlap, shared)", + "ShareableSet subtract Self (50% overlap, shared)", + "ShareableSet subtract Self (75% overlap, shared)", + "ShareableSet subtract Self (100% overlap, shared)", + ] + }, + { + "kind": "chart", + "title": "subtract with Array", + "tasks": [ + "ShareableSet subtract Array (0% overlap)", + "ShareableSet subtract Array (25% overlap)", + "ShareableSet subtract Array (50% overlap)", + "ShareableSet subtract Array (75% overlap)", + "ShareableSet subtract Array (100% overlap)", + ] + }, + ] + } + ] + }, + { + "kind": "group", + "title": "Reference comparisons", + "directory": "versus Set", + "contents": [ + { + "kind": "chart", + "title": "init from buffer of integers", + "tasks": [ + "ShareableSet init from unsafe buffer", + "Set init from unsafe buffer", + ] }, { - "kind": "group", - "title": "Reference comparisons", - "directory": "versus", - "contents": [ - { - "kind": "chart", - "title": "init from buffer of integers", - "tasks": [ - "ShareableSet init from unsafe buffer", - "Set init from unsafe buffer", - ] - }, - { - "kind": "chart", - "title": "init from range of integers", - "tasks": [ - "ShareableSet init from range", - "Set init from range", - ] - }, - { - "kind": "chart", - "title": "sequential iteration", - "tasks": [ - "ShareableSet sequential iteration", - "Set sequential iteration", - ] - }, - { - "kind": "chart", - "title": "sequential iteration using indices", - "tasks": [ - "ShareableSet sequential iteration, indices", - "Set sequential iteration, indices", - ] - }, - { - "kind": "chart", - "title": "successful random lookups", - "tasks": [ - "ShareableSet successful contains", - "Set successful contains", - ] - }, - { - "kind": "chart", - "title": "unsuccessful random lookups", - "tasks": [ - "ShareableSet unsuccessful contains", - "Set unsuccessful contains", - ] - }, - { - "kind": "chart", - "title": "insert", - "tasks": [ - "ShareableSet insert", - "Set insert", - "Set insert, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "insert-shared", - "tasks": [ - "ShareableSet insert, shared", - "Set insert, shared", - ] - }, - { - "kind": "chart", - "title": "model building with constant diffing", - "tasks": [ - "ShareableSet model diffing", - "Set model diffing", - ] - }, - { - "kind": "chart", - "title": "remove", - "tasks": [ - "ShareableSet remove", - "ShareableSet remove, shared", - "Set remove", - "Set remove, shared", - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "union (0% overlap)", - "tasks": [ - "ShareableSet union with Self (0% overlap, distinct)", - "ShareableSet union with Self (0% overlap, shared)", - "ShareableSet union with Array (0% overlap)", - "Set union with Self (0% overlap)", - "Set union with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (25% overlap)", - "tasks": [ - "ShareableSet union with Self (25% overlap, distinct)", - "ShareableSet union with Self (25% overlap, shared)", - "ShareableSet union with Array (25% overlap)", - "Set union with Self (25% overlap)", - "Set union with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (50% overlap)", - "tasks": [ - "ShareableSet union with Self (50% overlap, distinct)", - "ShareableSet union with Self (50% overlap, shared)", - "ShareableSet union with Array (50% overlap)", - "Set union with Self (50% overlap)", - "Set union with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (75% overlap)", - "tasks": [ - "ShareableSet union with Self (75% overlap, distinct)", - "ShareableSet union with Self (75% overlap, shared)", - "ShareableSet union with Array (75% overlap)", - "Set union with Self (75% overlap)", - "Set union with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (100% overlap)", - "tasks": [ - "ShareableSet union with Self (100% overlap, distinct)", - "ShareableSet union with Self (100% overlap, shared)", - "ShareableSet union with Array (100% overlap)", - "Set union with Self (100% overlap)", - "Set union with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "formUnion (0% overlap)", - "tasks": [ - "ShareableSet formUnion with Self (0% overlap, distinct)", - "ShareableSet formUnion with Self (0% overlap, shared)", - "ShareableSet formUnion with Array (0% overlap)", - "Set formUnion with Self (0% overlap)", - "Set formUnion with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (25% overlap)", - "tasks": [ - "ShareableSet formUnion with Self (25% overlap, distinct)", - "ShareableSet formUnion with Self (25% overlap, shared)", - "ShareableSet formUnion with Array (25% overlap)", - "Set formUnion with Self (25% overlap)", - "Set formUnion with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (50% overlap)", - "tasks": [ - "ShareableSet formUnion with Self (50% overlap, distinct)", - "ShareableSet formUnion with Self (50% overlap, shared)", - "ShareableSet formUnion with Array (50% overlap)", - "Set formUnion with Self (50% overlap)", - "Set formUnion with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (75% overlap)", - "tasks": [ - "ShareableSet formUnion with Self (75% overlap, distinct)", - "ShareableSet formUnion with Self (75% overlap, shared)", - "ShareableSet formUnion with Array (75% overlap)", - "Set formUnion with Self (75% overlap)", - "Set formUnion with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (100% overlap)", - "tasks": [ - "ShareableSet formUnion with Self (100% overlap, distinct)", - "ShareableSet formUnion with Self (100% overlap, shared)", - "ShareableSet formUnion with Array (100% overlap)", - "Set formUnion with Self (100% overlap)", - "Set formUnion with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "intersection (0% overlap)", - "tasks": [ - "ShareableSet intersection with Self (0% overlap, distinct)", - "ShareableSet intersection with Self (0% overlap, shared)", - "ShareableSet intersection with Array (0% overlap)", - "Set intersection with Self (0% overlap)", - "Set intersection with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (25% overlap)", - "tasks": [ - "ShareableSet intersection with Self (25% overlap, distinct)", - "ShareableSet intersection with Self (25% overlap, shared)", - "ShareableSet intersection with Array (25% overlap)", - "Set intersection with Self (25% overlap)", - "Set intersection with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (50% overlap)", - "tasks": [ - "ShareableSet intersection with Self (50% overlap, distinct)", - "ShareableSet intersection with Self (50% overlap, shared)", - "ShareableSet intersection with Array (50% overlap)", - "Set intersection with Self (50% overlap)", - "Set intersection with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (75% overlap)", - "tasks": [ - "ShareableSet intersection with Self (75% overlap, distinct)", - "ShareableSet intersection with Self (75% overlap, shared)", - "ShareableSet intersection with Array (75% overlap)", - "Set intersection with Self (75% overlap)", - "Set intersection with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (100% overlap)", - "tasks": [ - "ShareableSet intersection with Self (100% overlap, distinct)", - "ShareableSet intersection with Self (100% overlap, shared)", - "ShareableSet intersection with Array (100% overlap)", - "Set intersection with Self (100% overlap)", - "Set intersection with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "formIntersection (0% overlap)", - "tasks": [ - "ShareableSet formIntersection with Self (0% overlap, distinct)", - "ShareableSet formIntersection with Self (0% overlap, shared)", - "ShareableSet formIntersection with Array (0% overlap)", - "Set formIntersection with Self (0% overlap)", - "Set formIntersection with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (25% overlap)", - "tasks": [ - "ShareableSet formIntersection with Self (25% overlap, distinct)", - "ShareableSet formIntersection with Self (25% overlap, shared)", - "ShareableSet formIntersection with Array (25% overlap)", - "Set formIntersection with Self (25% overlap)", - "Set formIntersection with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (50% overlap)", - "tasks": [ - "ShareableSet formIntersection with Self (50% overlap, distinct)", - "ShareableSet formIntersection with Self (50% overlap, shared)", - "ShareableSet formIntersection with Array (50% overlap)", - "Set formIntersection with Self (50% overlap)", - "Set formIntersection with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (75% overlap)", - "tasks": [ - "ShareableSet formIntersection with Self (75% overlap, distinct)", - "ShareableSet formIntersection with Self (75% overlap, shared)", - "ShareableSet formIntersection with Array (75% overlap)", - "Set formIntersection with Self (75% overlap)", - "Set formIntersection with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (100% overlap)", - "tasks": [ - "ShareableSet formIntersection with Self (100% overlap, distinct)", - "ShareableSet formIntersection with Self (100% overlap, shared)", - "ShareableSet formIntersection with Array (100% overlap)", - "Set formIntersection with Self (100% overlap)", - "Set formIntersection with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "symmetricDifference (0% overlap)", - "tasks": [ - "ShareableSet symmetricDifference with Self (0% overlap, distinct)", - "ShareableSet symmetricDifference with Self (0% overlap, shared)", - "ShareableSet symmetricDifference with Array (0% overlap)", - "Set symmetricDifference with Self (0% overlap)", - "Set symmetricDifference with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (25% overlap)", - "tasks": [ - "ShareableSet symmetricDifference with Self (25% overlap, distinct)", - "ShareableSet symmetricDifference with Self (25% overlap, shared)", - "ShareableSet symmetricDifference with Array (25% overlap)", - "Set symmetricDifference with Self (25% overlap)", - "Set symmetricDifference with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (50% overlap)", - "tasks": [ - "ShareableSet symmetricDifference with Self (50% overlap, distinct)", - "ShareableSet symmetricDifference with Self (50% overlap, shared)", - "ShareableSet symmetricDifference with Array (50% overlap)", - "Set symmetricDifference with Self (50% overlap)", - "Set symmetricDifference with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (75% overlap)", - "tasks": [ - "ShareableSet symmetricDifference with Self (75% overlap, distinct)", - "ShareableSet symmetricDifference with Self (75% overlap, shared)", - "ShareableSet symmetricDifference with Array (75% overlap)", - "Set symmetricDifference with Self (75% overlap)", - "Set symmetricDifference with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (100% overlap)", - "tasks": [ - "ShareableSet symmetricDifference with Self (100% overlap, distinct)", - "ShareableSet symmetricDifference with Self (100% overlap, shared)", - "ShareableSet symmetricDifference with Array (100% overlap)", - "Set symmetricDifference with Self (100% overlap)", - "Set symmetricDifference with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "formSymmetricDifference (0% overlap)", - "tasks": [ - "ShareableSet formSymmetricDifference with Self (0% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (0% overlap, shared)", - "ShareableSet formSymmetricDifference with Array (0% overlap)", - "Set formSymmetricDifference with Self (0% overlap)", - "Set formSymmetricDifference with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (25% overlap)", - "tasks": [ - "ShareableSet formSymmetricDifference with Self (25% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (25% overlap, shared)", - "ShareableSet formSymmetricDifference with Array (25% overlap)", - "Set formSymmetricDifference with Self (25% overlap)", - "Set formSymmetricDifference with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (50% overlap)", - "tasks": [ - "ShareableSet formSymmetricDifference with Self (50% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (50% overlap, shared)", - "ShareableSet formSymmetricDifference with Array (50% overlap)", - "Set formSymmetricDifference with Self (50% overlap)", - "Set formSymmetricDifference with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (75% overlap)", - "tasks": [ - "ShareableSet formSymmetricDifference with Self (75% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (75% overlap, shared)", - "ShareableSet formSymmetricDifference with Array (75% overlap)", - "Set formSymmetricDifference with Self (75% overlap)", - "Set formSymmetricDifference with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (100% overlap)", - "tasks": [ - "ShareableSet formSymmetricDifference with Self (100% overlap, distinct)", - "ShareableSet formSymmetricDifference with Self (100% overlap, shared)", - "ShareableSet formSymmetricDifference with Array (100% overlap)", - "Set formSymmetricDifference with Self (100% overlap)", - "Set formSymmetricDifference with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subtracting (0% overlap)", - "tasks": [ - "ShareableSet subtracting Self (0% overlap, distinct)", - "ShareableSet subtracting Self (0% overlap, shared)", - "ShareableSet subtracting Array (0% overlap)", - "Set subtracting Self (0% overlap)", - "Set subtracting Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (25% overlap)", - "tasks": [ - "ShareableSet subtracting Self (25% overlap, distinct)", - "ShareableSet subtracting Self (25% overlap, shared)", - "ShareableSet subtracting Array (25% overlap)", - "Set subtracting Self (25% overlap)", - "Set subtracting Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (50% overlap)", - "tasks": [ - "ShareableSet subtracting Self (50% overlap, distinct)", - "ShareableSet subtracting Self (50% overlap, shared)", - "ShareableSet subtracting Array (50% overlap)", - "Set subtracting Self (50% overlap)", - "Set subtracting Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (75% overlap)", - "tasks": [ - "ShareableSet subtracting Self (75% overlap, distinct)", - "ShareableSet subtracting Self (75% overlap, shared)", - "ShareableSet subtracting Array (75% overlap)", - "Set subtracting Self (75% overlap)", - "Set subtracting Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (100% overlap)", - "tasks": [ - "ShareableSet subtracting Self (100% overlap, distinct)", - "ShareableSet subtracting Self (100% overlap, shared)", - "ShareableSet subtracting Array (100% overlap)", - "Set subtracting Self (100% overlap)", - "Set subtracting Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subtract (0% overlap)", - "tasks": [ - "ShareableSet subtract Self (0% overlap, distinct)", - "ShareableSet subtract Self (0% overlap, shared)", - "ShareableSet subtract Array (0% overlap)", - "Set subtract Self (0% overlap)", - "Set subtract Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (25% overlap)", - "tasks": [ - "ShareableSet subtract Self (25% overlap, distinct)", - "ShareableSet subtract Self (25% overlap, shared)", - "ShareableSet subtract Array (25% overlap)", - "Set subtract Self (25% overlap)", - "Set subtract Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (50% overlap)", - "tasks": [ - "ShareableSet subtract Self (50% overlap, distinct)", - "ShareableSet subtract Self (50% overlap, shared)", - "ShareableSet subtract Array (50% overlap)", - "Set subtract Self (50% overlap)", - "Set subtract Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (75% overlap)", - "tasks": [ - "ShareableSet subtract Self (75% overlap, distinct)", - "ShareableSet subtract Self (75% overlap, shared)", - "ShareableSet subtract Array (75% overlap)", - "Set subtract Self (75% overlap)", - "Set subtract Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (100% overlap)", - "tasks": [ - "ShareableSet subtract Self (100% overlap, distinct)", - "ShareableSet subtract Self (100% overlap, shared)", - "ShareableSet subtract Array (100% overlap)", - "Set subtract Self (100% overlap)", - "Set subtract Array (100% overlap)", - ] - }, - ] - }, - ] + "kind": "chart", + "title": "init from range of integers", + "tasks": [ + "ShareableSet init from range", + "Set init from range", + ] }, - ] + { + "kind": "chart", + "title": "sequential iteration", + "tasks": [ + "ShareableSet sequential iteration", + "Set sequential iteration", + ] + }, + { + "kind": "chart", + "title": "sequential iteration using indices", + "tasks": [ + "ShareableSet sequential iteration, indices", + "Set sequential iteration, indices", + ] + }, + { + "kind": "chart", + "title": "successful random lookups", + "tasks": [ + "ShareableSet successful contains", + "Set successful contains", + ] + }, + { + "kind": "chart", + "title": "unsuccessful random lookups", + "tasks": [ + "ShareableSet unsuccessful contains", + "Set unsuccessful contains", + ] + }, + { + "kind": "chart", + "title": "insert", + "tasks": [ + "ShareableSet insert", + "Set insert", + "Set insert, reserving capacity", + ] + }, + { + "kind": "chart", + "title": "insert-shared", + "tasks": [ + "ShareableSet insert, shared", + "Set insert, shared", + ] + }, + { + "kind": "chart", + "title": "model building with constant diffing", + "tasks": [ + "ShareableSet model diffing", + "Set model diffing" + ] + }, + { + "kind": "chart", + "title": "remove", + "tasks": [ + "ShareableSet remove", + "ShareableSet remove, shared", + "Set remove", + "Set remove, shared", + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "union (0% overlap)", + "tasks": [ + "ShareableSet union with Self (0% overlap, distinct)", + "ShareableSet union with Self (0% overlap, shared)", + "ShareableSet union with Array (0% overlap)", + "Set union with Self (0% overlap)", + "Set union with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (25% overlap)", + "tasks": [ + "ShareableSet union with Self (25% overlap, distinct)", + "ShareableSet union with Self (25% overlap, shared)", + "ShareableSet union with Array (25% overlap)", + "Set union with Self (25% overlap)", + "Set union with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (50% overlap)", + "tasks": [ + "ShareableSet union with Self (50% overlap, distinct)", + "ShareableSet union with Self (50% overlap, shared)", + "ShareableSet union with Array (50% overlap)", + "Set union with Self (50% overlap)", + "Set union with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (75% overlap)", + "tasks": [ + "ShareableSet union with Self (75% overlap, distinct)", + "ShareableSet union with Self (75% overlap, shared)", + "ShareableSet union with Array (75% overlap)", + "Set union with Self (75% overlap)", + "Set union with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "union (100% overlap)", + "tasks": [ + "ShareableSet union with Self (100% overlap, distinct)", + "ShareableSet union with Self (100% overlap, shared)", + "ShareableSet union with Array (100% overlap)", + "Set union with Self (100% overlap)", + "Set union with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "formUnion (0% overlap)", + "tasks": [ + "ShareableSet formUnion with Self (0% overlap, distinct)", + "ShareableSet formUnion with Self (0% overlap, shared)", + "ShareableSet formUnion with Array (0% overlap)", + "Set formUnion with Self (0% overlap)", + "Set formUnion with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (25% overlap)", + "tasks": [ + "ShareableSet formUnion with Self (25% overlap, distinct)", + "ShareableSet formUnion with Self (25% overlap, shared)", + "ShareableSet formUnion with Array (25% overlap)", + "Set formUnion with Self (25% overlap)", + "Set formUnion with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (50% overlap)", + "tasks": [ + "ShareableSet formUnion with Self (50% overlap, distinct)", + "ShareableSet formUnion with Self (50% overlap, shared)", + "ShareableSet formUnion with Array (50% overlap)", + "Set formUnion with Self (50% overlap)", + "Set formUnion with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (75% overlap)", + "tasks": [ + "ShareableSet formUnion with Self (75% overlap, distinct)", + "ShareableSet formUnion with Self (75% overlap, shared)", + "ShareableSet formUnion with Array (75% overlap)", + "Set formUnion with Self (75% overlap)", + "Set formUnion with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "formUnion (100% overlap)", + "tasks": [ + "ShareableSet formUnion with Self (100% overlap, distinct)", + "ShareableSet formUnion with Self (100% overlap, shared)", + "ShareableSet formUnion with Array (100% overlap)", + "Set formUnion with Self (100% overlap)", + "Set formUnion with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "intersection (0% overlap)", + "tasks": [ + "ShareableSet intersection with Self (0% overlap, distinct)", + "ShareableSet intersection with Self (0% overlap, shared)", + "ShareableSet intersection with Array (0% overlap)", + "Set intersection with Self (0% overlap)", + "Set intersection with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (25% overlap)", + "tasks": [ + "ShareableSet intersection with Self (25% overlap, distinct)", + "ShareableSet intersection with Self (25% overlap, shared)", + "ShareableSet intersection with Array (25% overlap)", + "Set intersection with Self (25% overlap)", + "Set intersection with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (50% overlap)", + "tasks": [ + "ShareableSet intersection with Self (50% overlap, distinct)", + "ShareableSet intersection with Self (50% overlap, shared)", + "ShareableSet intersection with Array (50% overlap)", + "Set intersection with Self (50% overlap)", + "Set intersection with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (75% overlap)", + "tasks": [ + "ShareableSet intersection with Self (75% overlap, distinct)", + "ShareableSet intersection with Self (75% overlap, shared)", + "ShareableSet intersection with Array (75% overlap)", + "Set intersection with Self (75% overlap)", + "Set intersection with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "intersection (100% overlap)", + "tasks": [ + "ShareableSet intersection with Self (100% overlap, distinct)", + "ShareableSet intersection with Self (100% overlap, shared)", + "ShareableSet intersection with Array (100% overlap)", + "Set intersection with Self (100% overlap)", + "Set intersection with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "formIntersection (0% overlap)", + "tasks": [ + "ShareableSet formIntersection with Self (0% overlap, distinct)", + "ShareableSet formIntersection with Self (0% overlap, shared)", + "ShareableSet formIntersection with Array (0% overlap)", + "Set formIntersection with Self (0% overlap)", + "Set formIntersection with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (25% overlap)", + "tasks": [ + "ShareableSet formIntersection with Self (25% overlap, distinct)", + "ShareableSet formIntersection with Self (25% overlap, shared)", + "ShareableSet formIntersection with Array (25% overlap)", + "Set formIntersection with Self (25% overlap)", + "Set formIntersection with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (50% overlap)", + "tasks": [ + "ShareableSet formIntersection with Self (50% overlap, distinct)", + "ShareableSet formIntersection with Self (50% overlap, shared)", + "ShareableSet formIntersection with Array (50% overlap)", + "Set formIntersection with Self (50% overlap)", + "Set formIntersection with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (75% overlap)", + "tasks": [ + "ShareableSet formIntersection with Self (75% overlap, distinct)", + "ShareableSet formIntersection with Self (75% overlap, shared)", + "ShareableSet formIntersection with Array (75% overlap)", + "Set formIntersection with Self (75% overlap)", + "Set formIntersection with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "formIntersection (100% overlap)", + "tasks": [ + "ShareableSet formIntersection with Self (100% overlap, distinct)", + "ShareableSet formIntersection with Self (100% overlap, shared)", + "ShareableSet formIntersection with Array (100% overlap)", + "Set formIntersection with Self (100% overlap)", + "Set formIntersection with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "symmetricDifference (0% overlap)", + "tasks": [ + "ShareableSet symmetricDifference with Self (0% overlap, distinct)", + "ShareableSet symmetricDifference with Self (0% overlap, shared)", + "ShareableSet symmetricDifference with Array (0% overlap)", + "Set symmetricDifference with Self (0% overlap)", + "Set symmetricDifference with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (25% overlap)", + "tasks": [ + "ShareableSet symmetricDifference with Self (25% overlap, distinct)", + "ShareableSet symmetricDifference with Self (25% overlap, shared)", + "ShareableSet symmetricDifference with Array (25% overlap)", + "Set symmetricDifference with Self (25% overlap)", + "Set symmetricDifference with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (50% overlap)", + "tasks": [ + "ShareableSet symmetricDifference with Self (50% overlap, distinct)", + "ShareableSet symmetricDifference with Self (50% overlap, shared)", + "ShareableSet symmetricDifference with Array (50% overlap)", + "Set symmetricDifference with Self (50% overlap)", + "Set symmetricDifference with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (75% overlap)", + "tasks": [ + "ShareableSet symmetricDifference with Self (75% overlap, distinct)", + "ShareableSet symmetricDifference with Self (75% overlap, shared)", + "ShareableSet symmetricDifference with Array (75% overlap)", + "Set symmetricDifference with Self (75% overlap)", + "Set symmetricDifference with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "symmetricDifference (100% overlap)", + "tasks": [ + "ShareableSet symmetricDifference with Self (100% overlap, distinct)", + "ShareableSet symmetricDifference with Self (100% overlap, shared)", + "ShareableSet symmetricDifference with Array (100% overlap)", + "Set symmetricDifference with Self (100% overlap)", + "Set symmetricDifference with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "formSymmetricDifference (0% overlap)", + "tasks": [ + "ShareableSet formSymmetricDifference with Self (0% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (0% overlap, shared)", + "ShareableSet formSymmetricDifference with Array (0% overlap)", + "Set formSymmetricDifference with Self (0% overlap)", + "Set formSymmetricDifference with Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (25% overlap)", + "tasks": [ + "ShareableSet formSymmetricDifference with Self (25% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (25% overlap, shared)", + "ShareableSet formSymmetricDifference with Array (25% overlap)", + "Set formSymmetricDifference with Self (25% overlap)", + "Set formSymmetricDifference with Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (50% overlap)", + "tasks": [ + "ShareableSet formSymmetricDifference with Self (50% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (50% overlap, shared)", + "ShareableSet formSymmetricDifference with Array (50% overlap)", + "Set formSymmetricDifference with Self (50% overlap)", + "Set formSymmetricDifference with Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (75% overlap)", + "tasks": [ + "ShareableSet formSymmetricDifference with Self (75% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (75% overlap, shared)", + "ShareableSet formSymmetricDifference with Array (75% overlap)", + "Set formSymmetricDifference with Self (75% overlap)", + "Set formSymmetricDifference with Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "formSymmetricDifference (100% overlap)", + "tasks": [ + "ShareableSet formSymmetricDifference with Self (100% overlap, distinct)", + "ShareableSet formSymmetricDifference with Self (100% overlap, shared)", + "ShareableSet formSymmetricDifference with Array (100% overlap)", + "Set formSymmetricDifference with Self (100% overlap)", + "Set formSymmetricDifference with Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subtracting (0% overlap)", + "tasks": [ + "ShareableSet subtracting Self (0% overlap, distinct)", + "ShareableSet subtracting Self (0% overlap, shared)", + "ShareableSet subtracting Array (0% overlap)", + "Set subtracting Self (0% overlap)", + "Set subtracting Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (25% overlap)", + "tasks": [ + "ShareableSet subtracting Self (25% overlap, distinct)", + "ShareableSet subtracting Self (25% overlap, shared)", + "ShareableSet subtracting Array (25% overlap)", + "Set subtracting Self (25% overlap)", + "Set subtracting Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (50% overlap)", + "tasks": [ + "ShareableSet subtracting Self (50% overlap, distinct)", + "ShareableSet subtracting Self (50% overlap, shared)", + "ShareableSet subtracting Array (50% overlap)", + "Set subtracting Self (50% overlap)", + "Set subtracting Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (75% overlap)", + "tasks": [ + "ShareableSet subtracting Self (75% overlap, distinct)", + "ShareableSet subtracting Self (75% overlap, shared)", + "ShareableSet subtracting Array (75% overlap)", + "Set subtracting Self (75% overlap)", + "Set subtracting Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtracting (100% overlap)", + "tasks": [ + "ShareableSet subtracting Self (100% overlap, distinct)", + "ShareableSet subtracting Self (100% overlap, shared)", + "ShareableSet subtracting Array (100% overlap)", + "Set subtracting Self (100% overlap)", + "Set subtracting Array (100% overlap)", + ] + }, + ] + }, + { + "kind": "variants", + "charts": [ + { + "kind": "chart", + "title": "subtract (0% overlap)", + "tasks": [ + "ShareableSet subtract Self (0% overlap, distinct)", + "ShareableSet subtract Self (0% overlap, shared)", + "ShareableSet subtract Array (0% overlap)", + "Set subtract Self (0% overlap)", + "Set subtract Array (0% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (25% overlap)", + "tasks": [ + "ShareableSet subtract Self (25% overlap, distinct)", + "ShareableSet subtract Self (25% overlap, shared)", + "ShareableSet subtract Array (25% overlap)", + "Set subtract Self (25% overlap)", + "Set subtract Array (25% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (50% overlap)", + "tasks": [ + "ShareableSet subtract Self (50% overlap, distinct)", + "ShareableSet subtract Self (50% overlap, shared)", + "ShareableSet subtract Array (50% overlap)", + "Set subtract Self (50% overlap)", + "Set subtract Array (50% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (75% overlap)", + "tasks": [ + "ShareableSet subtract Self (75% overlap, distinct)", + "ShareableSet subtract Self (75% overlap, shared)", + "ShareableSet subtract Array (75% overlap)", + "Set subtract Self (75% overlap)", + "Set subtract Array (75% overlap)", + ] + }, + { + "kind": "chart", + "title": "subtract (100% overlap)", + "tasks": [ + "ShareableSet subtract Self (100% overlap, distinct)", + "ShareableSet subtract Self (100% overlap, shared)", + "ShareableSet subtract Array (100% overlap)", + "Set subtract Self (100% overlap)", + "Set subtract Array (100% overlap)", + ] + }, + ] + }, + ] + }, + ] } diff --git a/Benchmarks/Package.swift b/Benchmarks/Package.swift index 83a700b6..9468c66d 100644 --- a/Benchmarks/Package.swift +++ b/Benchmarks/Package.swift @@ -29,9 +29,6 @@ let package = Package( .product(name: "Collections", package: "swift-collections"), .product(name: "CollectionsBenchmark", package: "swift-collections-benchmark"), "CppBenchmarks", - ], - resources: [ - .copy("Library.json"), ] ), .target( diff --git a/Benchmarks/Sources/Benchmarks/DequeBenchmarks.swift b/Benchmarks/Sources/Benchmarks/DequeBenchmarks.swift index 7f916254..a23558ec 100644 --- a/Benchmarks/Sources/Benchmarks/DequeBenchmarks.swift +++ b/Benchmarks/Sources/Benchmarks/DequeBenchmarks.swift @@ -40,7 +40,7 @@ extension Benchmark { } self.add( - title: "Deque sequential iteration (contiguous)", + title: "Deque sequential iteration (contiguous, iterator)", input: [Int].self ) { input in let deque = Deque(input) @@ -52,7 +52,7 @@ extension Benchmark { } self.add( - title: "Deque sequential iteration (discontiguous)", + title: "Deque sequential iteration (discontiguous, iterator)", input: [Int].self ) { input in let deque = Deque(discontiguous: input) @@ -63,6 +63,30 @@ extension Benchmark { } } + self.add( + title: "Deque sequential iteration (contiguous, indices)", + input: [Int].self + ) { input in + let deque = Deque(input) + return { timer in + for i in deque.indices { + blackHole(deque[i]) + } + } + } + + self.add( + title: "Deque sequential iteration (discontiguous, indices)", + input: [Int].self + ) { input in + let deque = Deque(discontiguous: input) + return { timer in + for i in deque.indices { + blackHole(deque[i]) + } + } + } + self.add( title: "Deque subscript get, random offsets (contiguous)", input: ([Int], [Int]).self diff --git a/Benchmarks/Sources/Benchmarks/Library.json b/Benchmarks/Sources/Benchmarks/Library.json deleted file mode 100644 index 477db811..00000000 --- a/Benchmarks/Sources/Benchmarks/Library.json +++ /dev/null @@ -1,2077 +0,0 @@ -{ - "kind": "group", - "title": "All results", - "directory": "Results", - "contents": [ - { - "kind": "group", - "title": "Individual types", - "directory": "single", - "contents": [ - { - "kind": "group", - "title": "Array", - "contents": [ - { - "kind": "chart", - "title": "operations", - "tasks": [ - "Array init from unsafe buffer", - "Array sequential iteration", - "Array subscript get, random offsets", - "Array append", - "Array append, reserving capacity", - "Array prepend", - "Array prepend, reserving capacity", - "Array removeFirst", - "Array removeLast", - "Array sort" - ] - }, - { - "kind": "chart", - "title": "access", - "tasks": [ - "Array sequential iteration", - "Array subscript get, random offsets" - ] - }, - { - "kind": "chart", - "title": "mutate", - "tasks": [ - "Array mutate through subscript", - "Array random swaps", - "Array partitioning around middle", - "Array sort" - ] - }, - ] - }, - { - "kind": "group", - "title": "Set", - "contents": [ - { - "kind": "chart", - "title": "operations", - "tasks": [ - "Set init from range", - "Set init from unsafe buffer", - "Set sequential iteration", - "Set successful contains", - "Set unsuccessful contains", - "Set insert", - "Set insert, reserving capacity", - "Set remove" - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "union with Self", - "tasks": [ - "Set union with Self (0% overlap)", - "Set union with Self (25% overlap)", - "Set union with Self (50% overlap)", - "Set union with Self (75% overlap)", - "Set union with Self (100% overlap)" - ] - }, - { - "kind": "chart", - "title": "union with Array", - "tasks": [ - "Set union with Array (0% overlap)", - "Set union with Array (25% overlap)", - "Set union with Array (50% overlap)", - "Set union with Array (75% overlap)", - "Set union with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion with Self", - "tasks": [ - "Set formUnion with Self (0% overlap)", - "Set formUnion with Self (25% overlap)", - "Set formUnion with Self (50% overlap)", - "Set formUnion with Self (75% overlap)", - "Set formUnion with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion with Array", - "tasks": [ - "Set formUnion with Array (0% overlap)", - "Set formUnion with Array (25% overlap)", - "Set formUnion with Array (50% overlap)", - "Set formUnion with Array (75% overlap)", - "Set formUnion with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "intersection with Self", - "tasks": [ - "Set intersection with Self (0% overlap)", - "Set intersection with Self (25% overlap)", - "Set intersection with Self (50% overlap)", - "Set intersection with Self (75% overlap)", - "Set intersection with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection with Array", - "tasks": [ - "Set intersection with Array (0% overlap)", - "Set intersection with Array (25% overlap)", - "Set intersection with Array (50% overlap)", - "Set intersection with Array (75% overlap)", - "Set intersection with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection with Self", - "tasks": [ - "Set formIntersection with Self (0% overlap)", - "Set formIntersection with Self (25% overlap)", - "Set formIntersection with Self (50% overlap)", - "Set formIntersection with Self (75% overlap)", - "Set formIntersection with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection with Array", - "tasks": [ - "Set formIntersection with Array (0% overlap)", - "Set formIntersection with Array (25% overlap)", - "Set formIntersection with Array (50% overlap)", - "Set formIntersection with Array (75% overlap)", - "Set formIntersection with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "symmetricDifference with Self", - "tasks": [ - "Set symmetricDifference with Self (0% overlap)", - "Set symmetricDifference with Self (25% overlap)", - "Set symmetricDifference with Self (50% overlap)", - "Set symmetricDifference with Self (75% overlap)", - "Set symmetricDifference with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference with Array", - "tasks": [ - "Set symmetricDifference with Array (0% overlap)", - "Set symmetricDifference with Array (25% overlap)", - "Set symmetricDifference with Array (50% overlap)", - "Set symmetricDifference with Array (75% overlap)", - "Set symmetricDifference with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference with Self", - "tasks": [ - "Set formSymmetricDifference with Self (0% overlap)", - "Set formSymmetricDifference with Self (25% overlap)", - "Set formSymmetricDifference with Self (50% overlap)", - "Set formSymmetricDifference with Self (75% overlap)", - "Set formSymmetricDifference with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference with Array", - "tasks": [ - "Set formSymmetricDifference with Array (0% overlap)", - "Set formSymmetricDifference with Array (25% overlap)", - "Set formSymmetricDifference with Array (50% overlap)", - "Set formSymmetricDifference with Array (75% overlap)", - "Set formSymmetricDifference with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subtracting Self", - "tasks": [ - "Set subtracting Self (0% overlap)", - "Set subtracting Self (25% overlap)", - "Set subtracting Self (50% overlap)", - "Set subtracting Self (75% overlap)", - "Set subtracting Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting Array", - "tasks": [ - "Set subtracting Array (0% overlap)", - "Set subtracting Array (25% overlap)", - "Set subtracting Array (50% overlap)", - "Set subtracting Array (75% overlap)", - "Set subtracting Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract Self", - "tasks": [ - "Set subtract Self (0% overlap)", - "Set subtract Self (25% overlap)", - "Set subtract Self (50% overlap)", - "Set subtract Self (75% overlap)", - "Set subtract Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract with Array", - "tasks": [ - "Set subtract Array (0% overlap)", - "Set subtract Array (25% overlap)", - "Set subtract Array (50% overlap)", - "Set subtract Array (75% overlap)", - "Set subtract Array (100% overlap)", - ] - }, - ] - }, - ] - }, - { - "kind": "group", - "title": "Dictionary", - "contents": [ - { - "kind": "chart", - "title": "operations", - "tasks": [ - "Dictionary init(uniqueKeysWithValues:)", - "Dictionary sequential iteration", - "Dictionary subscript, successful lookups", - "Dictionary subscript, insert", - "Dictionary subscript, remove existing", - ] - }, - { - "kind": "chart", - "title": "iteration", - "tasks": [ - "Dictionary sequential iteration", - "Dictionary.Keys sequential iteration", - "Dictionary.Values sequential iteration", - "Dictionary sequential iteration, indices" - ] - }, - { - "kind": "chart", - "title": "lookups", - "tasks": [ - "Dictionary subscript, successful lookups", - "Dictionary subscript, unsuccessful lookups", - "Dictionary defaulted subscript, successful lookups", - "Dictionary defaulted subscript, unsuccessful lookups", - "Dictionary successful index(forKey:)", - "Dictionary unsuccessful index(forKey:)", - ] - }, - { - "kind": "chart", - "title": "subscript", - "tasks": [ - "Dictionary subscript, successful lookups", - "Dictionary subscript, unsuccessful lookups", - "Dictionary subscript, noop setter", - "Dictionary subscript, set existing", - "Dictionary subscript, _modify", - "Dictionary subscript, insert", - "Dictionary subscript, insert, reserving capacity", - "Dictionary subscript, remove existing", - "Dictionary subscript, remove missing", - ] - }, - { - "kind": "chart", - "title": "defaulted subscript", - "tasks": [ - "Dictionary defaulted subscript, successful lookups", - "Dictionary defaulted subscript, unsuccessful lookups", - "Dictionary defaulted subscript, _modify existing", - "Dictionary defaulted subscript, _modify missing", - ] - }, - { - "kind": "chart", - "title": "mutations", - "tasks": [ - "Dictionary updateValue(_:forKey:), existing", - "Dictionary subscript, set existing", - "Dictionary subscript, _modify", - "Dictionary defaulted subscript, _modify existing", - ] - }, - { - "kind": "chart", - "title": "removals", - "tasks": [ - "Dictionary subscript, remove existing", - "Dictionary subscript, remove missing", - "Dictionary random removals (existing keys)", - "Dictionary random removals (missing keys)", - ] - }, - ] - }, - { - "kind": "group", - "title": "Deque", - "contents": [ - { - "kind": "chart", - "title": "operations", - "tasks": [ - "Deque init from unsafe buffer", - "Deque sequential iteration (contiguous)", - "Deque subscript get, random offsets (contiguous)", - "Deque append", - "Deque append, reserving capacity", - "Deque prepend", - "Deque prepend, reserving capacity", - "Deque removeFirst (contiguous)", - "Deque removeLast (contiguous)", - "Deque sort (contiguous)", - "Deque sort (discontiguous)" - ] - }, - { - "kind": "chart", - "title": "access", - "tasks": [ - "Deque sequential iteration (contiguous)", - "Deque sequential iteration (discontiguous)", - "Deque subscript get, random offsets (contiguous)", - "Deque subscript get, random offsets (discontiguous)", - "Deque mutate through subscript (contiguous)", - "Deque mutate through subscript (discontiguous)" - ] - }, - { - "kind": "chart", - "title": "mutate", - "tasks": [ - "Deque mutate through subscript (contiguous)", - "Deque mutate through subscript (discontiguous)", - "Deque random swaps (contiguous)", - "Deque random swaps (discontiguous)", - "Deque partitioning around middle (contiguous)", - "Deque partitioning around middle (discontiguous)", - "Deque sort (contiguous)", - "Deque sort (discontiguous)" - ] - }, - { - "kind": "chart", - "title": "push", - "tasks": [ - "Deque append", - "Deque append, reserving capacity", - "Deque prepend", - "Deque prepend, reserving capacity" - ] - }, - { - "kind": "chart", - "title": "pop", - "tasks": [ - "Deque removeFirst (contiguous)", - "Deque removeFirst (discontiguous)", - "Deque removeLast (contiguous)", - "Deque removeLast (discontiguous)" - ] - }, - ] - }, - { - "kind": "group", - "title": "OrderedSet", - "contents": [ - { - "kind": "chart", - "title": "operations", - "tasks": [ - "OrderedSet init from range", - "OrderedSet init from unsafe buffer", - "OrderedSet sequential iteration", - "OrderedSet successful contains", - "OrderedSet unsuccessful contains", - "OrderedSet append", - "OrderedSet append, reserving capacity", - "OrderedSet remove", - ] - }, - { - "kind": "chart", - "title": "initializers", - "tasks": [ - "OrderedSet init from range", - "OrderedSet init from unsafe buffer", - "OrderedSet init(uncheckedUniqueElements:) from range" - ] - }, - { - "kind": "chart", - "title": "mutations", - "tasks": [ - "OrderedSet random swaps", - "OrderedSet partitioning around middle", - "OrderedSet sort", - ] - }, - { - "kind": "chart", - "title": "range replaceable", - "tasks": [ - "OrderedSet append", - "OrderedSet append, reserving capacity", - "OrderedSet prepend", - "OrderedSet prepend, reserving capacity", - "OrderedSet random insertions, reserving capacity", - "OrderedSet remove", - "OrderedSet removeLast", - "OrderedSet removeFirst", - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "union with Self", - "tasks": [ - "OrderedSet union with Self (0% overlap)", - "OrderedSet union with Self (25% overlap)", - "OrderedSet union with Self (50% overlap)", - "OrderedSet union with Self (75% overlap)", - "OrderedSet union with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "union with Array", - "tasks": [ - "OrderedSet union with Array (0% overlap)", - "OrderedSet union with Array (25% overlap)", - "OrderedSet union with Array (50% overlap)", - "OrderedSet union with Array (75% overlap)", - "OrderedSet union with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion with Self", - "tasks": [ - "OrderedSet formUnion with Self (0% overlap)", - "OrderedSet formUnion with Self (25% overlap)", - "OrderedSet formUnion with Self (50% overlap)", - "OrderedSet formUnion with Self (75% overlap)", - "OrderedSet formUnion with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion with Array", - "tasks": [ - "OrderedSet formUnion with Array (0% overlap)", - "OrderedSet formUnion with Array (25% overlap)", - "OrderedSet formUnion with Array (50% overlap)", - "OrderedSet formUnion with Array (75% overlap)", - "OrderedSet formUnion with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "intersection with Self", - "tasks": [ - "OrderedSet intersection with Self (0% overlap)", - "OrderedSet intersection with Self (25% overlap)", - "OrderedSet intersection with Self (50% overlap)", - "OrderedSet intersection with Self (75% overlap)", - "OrderedSet intersection with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection with Array", - "tasks": [ - "OrderedSet intersection with Array (0% overlap)", - "OrderedSet intersection with Array (25% overlap)", - "OrderedSet intersection with Array (50% overlap)", - "OrderedSet intersection with Array (75% overlap)", - "OrderedSet intersection with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection with Self", - "tasks": [ - "OrderedSet formIntersection with Self (0% overlap)", - "OrderedSet formIntersection with Self (25% overlap)", - "OrderedSet formIntersection with Self (50% overlap)", - "OrderedSet formIntersection with Self (75% overlap)", - "OrderedSet formIntersection with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection with Array", - "tasks": [ - "OrderedSet formIntersection with Array (0% overlap)", - "OrderedSet formIntersection with Array (25% overlap)", - "OrderedSet formIntersection with Array (50% overlap)", - "OrderedSet formIntersection with Array (75% overlap)", - "OrderedSet formIntersection with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "symmetricDifference with Self", - "tasks": [ - "OrderedSet symmetricDifference with Self (0% overlap)", - "OrderedSet symmetricDifference with Self (25% overlap)", - "OrderedSet symmetricDifference with Self (50% overlap)", - "OrderedSet symmetricDifference with Self (75% overlap)", - "OrderedSet symmetricDifference with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference with Array", - "tasks": [ - "OrderedSet symmetricDifference with Array (0% overlap)", - "OrderedSet symmetricDifference with Array (25% overlap)", - "OrderedSet symmetricDifference with Array (50% overlap)", - "OrderedSet symmetricDifference with Array (75% overlap)", - "OrderedSet symmetricDifference with Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference with Self", - "tasks": [ - "OrderedSet formSymmetricDifference with Self (0% overlap)", - "OrderedSet formSymmetricDifference with Self (25% overlap)", - "OrderedSet formSymmetricDifference with Self (50% overlap)", - "OrderedSet formSymmetricDifference with Self (75% overlap)", - "OrderedSet formSymmetricDifference with Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference with Array", - "tasks": [ - "OrderedSet formSymmetricDifference with Array (0% overlap)", - "OrderedSet formSymmetricDifference with Array (25% overlap)", - "OrderedSet formSymmetricDifference with Array (50% overlap)", - "OrderedSet formSymmetricDifference with Array (75% overlap)", - "OrderedSet formSymmetricDifference with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subtracting Self", - "tasks": [ - "OrderedSet subtracting Self (0% overlap)", - "OrderedSet subtracting Self (25% overlap)", - "OrderedSet subtracting Self (50% overlap)", - "OrderedSet subtracting Self (75% overlap)", - "OrderedSet subtracting Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting Array", - "tasks": [ - "OrderedSet subtracting Array (0% overlap)", - "OrderedSet subtracting Array (25% overlap)", - "OrderedSet subtracting Array (50% overlap)", - "OrderedSet subtracting Array (75% overlap)", - "OrderedSet subtracting Array (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract Self", - "tasks": [ - "OrderedSet subtract Self (0% overlap)", - "OrderedSet subtract Self (25% overlap)", - "OrderedSet subtract Self (50% overlap)", - "OrderedSet subtract Self (75% overlap)", - "OrderedSet subtract Self (100% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract with Array", - "tasks": [ - "OrderedSet subtract Array (0% overlap)", - "OrderedSet subtract Array (25% overlap)", - "OrderedSet subtract Array (50% overlap)", - "OrderedSet subtract Array (75% overlap)", - "OrderedSet subtract Array (100% overlap)", - ] - }, - ] - }, - ] - }, - { - "kind": "group", - "title": "OrderedDictionary", - "contents": [ - { - "kind": "chart", - "title": "operations", - "tasks": [ - "OrderedDictionary init(uniqueKeysWithValues:)", - "OrderedDictionary sequential iteration", - "OrderedDictionary subscript, successful lookups", - "OrderedDictionary subscript, append", - "OrderedDictionary subscript, remove existing", - ] - }, - { - "kind": "chart", - "title": "initializers", - "tasks": [ - "OrderedDictionary init(uniqueKeysWithValues:)", - "OrderedDictionary init(uncheckedUniqueKeysWithValues:)", - "OrderedDictionary init(uncheckedUniqueKeys:values:)" - ] - }, - { - "kind": "chart", - "title": "iteration", - "tasks": [ - "OrderedDictionary sequential iteration", - "OrderedDictionary.Keys sequential iteration", - "OrderedDictionary.Values sequential iteration" - ] - }, - { - "kind": "chart", - "title": "lookups", - "tasks": [ - "OrderedDictionary subscript, successful lookups", - "OrderedDictionary subscript, unsuccessful lookups", - "OrderedDictionary defaulted subscript, successful lookups", - "OrderedDictionary defaulted subscript, unsuccessful lookups", - "OrderedDictionary successful index(forKey:)", - "OrderedDictionary unsuccessful index(forKey:)", - ] - }, - { - "kind": "chart", - "title": "subscript", - "tasks": [ - "OrderedDictionary subscript, successful lookups", - "OrderedDictionary subscript, unsuccessful lookups", - "OrderedDictionary subscript, noop setter", - "OrderedDictionary subscript, set existing", - "OrderedDictionary subscript, _modify", - "OrderedDictionary subscript, append", - "OrderedDictionary subscript, append, reserving capacity", - "OrderedDictionary subscript, remove existing", - "OrderedDictionary subscript, remove missing", - ] - }, - { - "kind": "chart", - "title": "defaulted subscript", - "tasks": [ - "OrderedDictionary defaulted subscript, successful lookups", - "OrderedDictionary defaulted subscript, unsuccessful lookups", - "OrderedDictionary defaulted subscript, _modify existing", - "OrderedDictionary defaulted subscript, _modify missing", - ] - }, - { - "kind": "chart", - "title": "mutations", - "tasks": [ - "OrderedDictionary updateValue(_:forKey:), existing", - "OrderedDictionary subscript, set existing", - "OrderedDictionary subscript, _modify", - "OrderedDictionary defaulted subscript, _modify existing", - "OrderedDictionary random swaps", - "OrderedDictionary partitioning around middle", - "OrderedDictionary sort", - ] - }, - { - "kind": "chart", - "title": "removals", - "tasks": [ - "OrderedDictionary subscript, remove existing", - "OrderedDictionary subscript, remove missing", - "OrderedDictionary removeLast", - "OrderedDictionary removeFirst", - "OrderedDictionary random removals (offset-based)", - "OrderedDictionary random removals (existing keys)", - "OrderedDictionary random removals (missing keys)", - ] - }, - ] - }, - { - "kind": "group", - "title": "Heap", - "contents": [ - { - "kind": "chart", - "title": "operations", - "tasks": [ - "Heap init from range", - "Heap insert", - "Heap insert(contentsOf:)", - "Heap popMax", - "Heap popMin" - ] - }, - { - "kind": "chart", - "title": "initializers", - "tasks": [ - "Heap init from range", - "Heap init from buffer" - ] - }, - { - "kind": "chart", - "title": "insert", - "tasks": [ - "Heap insert", - "Heap insert(contentsOf:)" - ] - }, - { - "kind": "chart", - "title": "remove", - "tasks": [ - "Heap popMax", - "Heap popMin" - ] - } - ] - }, - ] - }, - { - "kind": "group", - "title": "Against other Swift collections", - "directory": "stdlib", - "contents": [ - { - "kind": "group", - "title": "Deque vs Array", - "contents": [ - { - "kind": "chart", - "title": "init from buffer of integers", - "tasks": [ - "Deque init from unsafe buffer", - "Array init from unsafe buffer" - ] - }, - { - "kind": "chart", - "title": "sequential iteration", - "tasks": [ - "Deque sequential iteration (contiguous)", - "Deque sequential iteration (discontiguous)", - "Array sequential iteration", - ] - }, - { - "kind": "chart", - "title": "random-access offset lookups", - "tasks": [ - "Deque subscript get, random offsets (contiguous)", - "Deque subscript get, random offsets (discontiguous)", - "Array subscript get, random offsets" - ] - }, - { - "kind": "chart", - "title": "mutate through subscript", - "tasks": [ - "Deque mutate through subscript (contiguous)", - "Deque mutate through subscript (discontiguous)", - "Array mutate through subscript" - ] - }, - { - "kind": "chart", - "title": "random swaps", - "tasks": [ - "Deque random swaps (contiguous)", - "Deque random swaps (discontiguous)", - "Array random swaps", - ] - }, - { - "kind": "chart", - "title": "partitioning around middle", - "tasks": [ - "Deque partitioning around middle (contiguous)", - "Deque partitioning around middle (discontiguous)", - "Array partitioning around middle", - ] - }, - { - "kind": "chart", - "title": "sort", - "tasks": [ - "Deque sort (contiguous)", - "Deque sort (discontiguous)", - "Array sort", - ] - }, - { - "kind": "chart", - "title": "append individual integers", - "tasks": [ - "Deque append", - "Deque append, reserving capacity", - "Array append", - "Array append, reserving capacity" - ] - }, - { - "kind": "chart", - "title": "prepend individual integers", - "tasks": [ - "Deque prepend", - "Deque prepend, reserving capacity", - "Array prepend", - "Array prepend, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "random insertions", - "tasks": [ - "Deque random insertions", - "Array random insertions", - ] - }, - { - "kind": "chart", - "title": "removeFirst", - "tasks": [ - "Deque removeFirst (contiguous)", - "Deque removeFirst (discontiguous)", - "Array removeFirst", - ] - }, - { - "kind": "chart", - "title": "removeLast", - "tasks": [ - "Deque removeLast (contiguous)", - "Deque removeLast (discontiguous)", - "Array removeLast", - ] - }, - { - "kind": "chart", - "title": "random removals", - "tasks": [ - "Deque random removals (contiguous)", - "Deque random removals (discontiguous)", - "Array random removals", - ] - }, - ] - }, - { - "kind": "group", - "title": "OrderedSet vs Set", - "contents": [ - { - "kind": "chart", - "title": "init from buffer of integers", - "tasks": [ - "OrderedSet init from unsafe buffer", - "Set init from unsafe buffer", - ] - }, - { - "kind": "chart", - "title": "init from range of integers", - "tasks": [ - "OrderedSet init from range", - "Set init from range", - ] - }, - { - "kind": "chart", - "title": "sequential iteration", - "tasks": [ - "OrderedSet sequential iteration", - "Set sequential iteration", - ] - }, - { - "kind": "chart", - "title": "successful random lookups", - "tasks": [ - "OrderedSet successful contains", - "Set successful contains", - ] - }, - { - "kind": "chart", - "title": "unsuccessful random lookups", - "tasks": [ - "OrderedSet unsuccessful contains", - "Set unsuccessful contains", - ] - }, - { - "kind": "chart", - "title": "insert", - "tasks": [ - "OrderedSet append", - "OrderedSet append, reserving capacity", - "Set insert", - "Set insert, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "remove", - "tasks": [ - "OrderedSet remove", - "Set remove", - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "union (0% overlap)", - "tasks": [ - "OrderedSet union with Self (0% overlap)", - "OrderedSet union with Array (0% overlap)", - "Set union with Self (0% overlap)", - "Set union with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (25% overlap)", - "tasks": [ - "OrderedSet union with Self (25% overlap)", - "OrderedSet union with Array (25% overlap)", - "Set union with Self (25% overlap)", - "Set union with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (50% overlap)", - "tasks": [ - "OrderedSet union with Self (50% overlap)", - "OrderedSet union with Array (50% overlap)", - "Set union with Self (50% overlap)", - "Set union with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (75% overlap)", - "tasks": [ - "OrderedSet union with Self (75% overlap)", - "OrderedSet union with Array (75% overlap)", - "Set union with Self (75% overlap)", - "Set union with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "union (100% overlap)", - "tasks": [ - "OrderedSet union with Self (100% overlap)", - "OrderedSet union with Array (100% overlap)", - "Set union with Self (100% overlap)", - "Set union with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "formUnion (0% overlap)", - "tasks": [ - "OrderedSet formUnion with Self (0% overlap)", - "OrderedSet formUnion with Array (0% overlap)", - "Set formUnion with Self (0% overlap)", - "Set formUnion with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (25% overlap)", - "tasks": [ - "OrderedSet formUnion with Self (25% overlap)", - "OrderedSet formUnion with Array (25% overlap)", - "Set formUnion with Self (25% overlap)", - "Set formUnion with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (50% overlap)", - "tasks": [ - "OrderedSet formUnion with Self (50% overlap)", - "OrderedSet formUnion with Array (50% overlap)", - "Set formUnion with Self (50% overlap)", - "Set formUnion with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (75% overlap)", - "tasks": [ - "OrderedSet formUnion with Self (75% overlap)", - "OrderedSet formUnion with Array (75% overlap)", - "Set formUnion with Self (75% overlap)", - "Set formUnion with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "formUnion (100% overlap)", - "tasks": [ - "OrderedSet formUnion with Self (100% overlap)", - "OrderedSet formUnion with Array (100% overlap)", - "Set formUnion with Self (100% overlap)", - "Set formUnion with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "intersection (0% overlap)", - "tasks": [ - "OrderedSet intersection with Self (0% overlap)", - "OrderedSet intersection with Array (0% overlap)", - "Set intersection with Self (0% overlap)", - "Set intersection with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (25% overlap)", - "tasks": [ - "OrderedSet intersection with Self (25% overlap)", - "OrderedSet intersection with Array (25% overlap)", - "Set intersection with Self (25% overlap)", - "Set intersection with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (50% overlap)", - "tasks": [ - "OrderedSet intersection with Self (50% overlap)", - "OrderedSet intersection with Array (50% overlap)", - "Set intersection with Self (50% overlap)", - "Set intersection with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (75% overlap)", - "tasks": [ - "OrderedSet intersection with Self (75% overlap)", - "OrderedSet intersection with Array (75% overlap)", - "Set intersection with Self (75% overlap)", - "Set intersection with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "intersection (100% overlap)", - "tasks": [ - "OrderedSet intersection with Self (100% overlap)", - "OrderedSet intersection with Array (100% overlap)", - "Set intersection with Self (100% overlap)", - "Set intersection with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "formIntersection (0% overlap)", - "tasks": [ - "OrderedSet formIntersection with Self (0% overlap)", - "OrderedSet formIntersection with Array (0% overlap)", - "Set formIntersection with Self (0% overlap)", - "Set formIntersection with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (25% overlap)", - "tasks": [ - "OrderedSet formIntersection with Self (25% overlap)", - "OrderedSet formIntersection with Array (25% overlap)", - "Set formIntersection with Self (25% overlap)", - "Set formIntersection with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (50% overlap)", - "tasks": [ - "OrderedSet formIntersection with Self (50% overlap)", - "OrderedSet formIntersection with Array (50% overlap)", - "Set formIntersection with Self (50% overlap)", - "Set formIntersection with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (75% overlap)", - "tasks": [ - "OrderedSet formIntersection with Self (75% overlap)", - "OrderedSet formIntersection with Array (75% overlap)", - "Set formIntersection with Self (75% overlap)", - "Set formIntersection with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "formIntersection (100% overlap)", - "tasks": [ - "OrderedSet formIntersection with Self (100% overlap)", - "OrderedSet formIntersection with Array (100% overlap)", - "Set formIntersection with Self (100% overlap)", - "Set formIntersection with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "symmetricDifference (0% overlap)", - "tasks": [ - "OrderedSet symmetricDifference with Self (0% overlap)", - "OrderedSet symmetricDifference with Array (0% overlap)", - "Set symmetricDifference with Self (0% overlap)", - "Set symmetricDifference with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (25% overlap)", - "tasks": [ - "OrderedSet symmetricDifference with Self (25% overlap)", - "OrderedSet symmetricDifference with Array (25% overlap)", - "Set symmetricDifference with Self (25% overlap)", - "Set symmetricDifference with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (50% overlap)", - "tasks": [ - "OrderedSet symmetricDifference with Self (50% overlap)", - "OrderedSet symmetricDifference with Array (50% overlap)", - "Set symmetricDifference with Self (50% overlap)", - "Set symmetricDifference with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (75% overlap)", - "tasks": [ - "OrderedSet symmetricDifference with Self (75% overlap)", - "OrderedSet symmetricDifference with Array (75% overlap)", - "Set symmetricDifference with Self (75% overlap)", - "Set symmetricDifference with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "symmetricDifference (100% overlap)", - "tasks": [ - "OrderedSet symmetricDifference with Self (100% overlap)", - "OrderedSet symmetricDifference with Array (100% overlap)", - "Set symmetricDifference with Self (100% overlap)", - "Set symmetricDifference with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "formSymmetricDifference (0% overlap)", - "tasks": [ - "OrderedSet formSymmetricDifference with Self (0% overlap)", - "OrderedSet formSymmetricDifference with Array (0% overlap)", - "Set formSymmetricDifference with Self (0% overlap)", - "Set formSymmetricDifference with Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (25% overlap)", - "tasks": [ - "OrderedSet formSymmetricDifference with Self (25% overlap)", - "OrderedSet formSymmetricDifference with Array (25% overlap)", - "Set formSymmetricDifference with Self (25% overlap)", - "Set formSymmetricDifference with Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (50% overlap)", - "tasks": [ - "OrderedSet formSymmetricDifference with Self (50% overlap)", - "OrderedSet formSymmetricDifference with Array (50% overlap)", - "Set formSymmetricDifference with Self (50% overlap)", - "Set formSymmetricDifference with Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (75% overlap)", - "tasks": [ - "OrderedSet formSymmetricDifference with Self (75% overlap)", - "OrderedSet formSymmetricDifference with Array (75% overlap)", - "Set formSymmetricDifference with Self (75% overlap)", - "Set formSymmetricDifference with Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "formSymmetricDifference (100% overlap)", - "tasks": [ - "OrderedSet formSymmetricDifference with Self (100% overlap)", - "OrderedSet formSymmetricDifference with Array (100% overlap)", - "Set formSymmetricDifference with Self (100% overlap)", - "Set formSymmetricDifference with Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subtracting (0% overlap)", - "tasks": [ - "OrderedSet subtracting Self (0% overlap)", - "OrderedSet subtracting Array (0% overlap)", - "Set subtracting Self (0% overlap)", - "Set subtracting Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (25% overlap)", - "tasks": [ - "OrderedSet subtracting Self (25% overlap)", - "OrderedSet subtracting Array (25% overlap)", - "Set subtracting Self (25% overlap)", - "Set subtracting Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (50% overlap)", - "tasks": [ - "OrderedSet subtracting Self (50% overlap)", - "OrderedSet subtracting Array (50% overlap)", - "Set subtracting Self (50% overlap)", - "Set subtracting Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (75% overlap)", - "tasks": [ - "OrderedSet subtracting Self (75% overlap)", - "OrderedSet subtracting Array (75% overlap)", - "Set subtracting Self (75% overlap)", - "Set subtracting Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtracting (100% overlap)", - "tasks": [ - "OrderedSet subtracting Self (100% overlap)", - "OrderedSet subtracting Array (100% overlap)", - "Set subtracting Self (100% overlap)", - "Set subtracting Array (100% overlap)", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subtract (0% overlap)", - "tasks": [ - "OrderedSet subtract Self (0% overlap)", - "OrderedSet subtract Array (0% overlap)", - "Set subtract Self (0% overlap)", - "Set subtract Array (0% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (25% overlap)", - "tasks": [ - "OrderedSet subtract Self (25% overlap)", - "OrderedSet subtract Array (25% overlap)", - "Set subtract Self (25% overlap)", - "Set subtract Array (25% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (50% overlap)", - "tasks": [ - "OrderedSet subtract Self (50% overlap)", - "OrderedSet subtract Array (50% overlap)", - "Set subtract Self (50% overlap)", - "Set subtract Array (50% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (75% overlap)", - "tasks": [ - "OrderedSet subtract Self (75% overlap)", - "OrderedSet subtract Array (75% overlap)", - "Set subtract Self (75% overlap)", - "Set subtract Array (75% overlap)", - ] - }, - { - "kind": "chart", - "title": "subtract (100% overlap)", - "tasks": [ - "OrderedSet subtract Self (100% overlap)", - "OrderedSet subtract Array (100% overlap)", - "Set subtract Self (100% overlap)", - "Set subtract Array (100% overlap)", - ] - }, - ] - }, - ] - }, - { - "kind": "group", - "title": "OrderedDictionary vs Dictionary", - "contents": [ - { - "kind": "chart", - "title": "initializers", - "tasks": [ - "Dictionary init(uniqueKeysWithValues:)", - "OrderedDictionary init(uniqueKeysWithValues:)", - "OrderedDictionary init(uncheckedUniqueKeysWithValues:)", - "OrderedDictionary init(uncheckedUniqueKeys:values:)" - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "iteration", - "tasks": [ - "Dictionary sequential iteration", - "OrderedDictionary sequential iteration", - ] - }, - { - "kind": "chart", - "title": "Keys iteration", - "tasks": [ - "Dictionary.Keys sequential iteration", - "OrderedDictionary.Keys sequential iteration", - ] - }, - { - "kind": "chart", - "title": "Values iteration", - "tasks": [ - "Dictionary.Values sequential iteration", - "OrderedDictionary.Values sequential iteration", - ] - }, - { - "kind": "chart", - "title": "Values iteration", - "tasks": [ - "Dictionary.Values sequential iteration", - "OrderedDictionary.Values sequential iteration", - ] - }, - ] - }, - { - "kind": "chart", - "title": "index(forKey:)", - "tasks": [ - "Dictionary successful index(forKey:)", - "Dictionary unsuccessful index(forKey:)", - "OrderedDictionary successful index(forKey:)", - "OrderedDictionary unsuccessful index(forKey:)", - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "subscript lookups", - "tasks": [ - "Dictionary subscript, successful lookups", - "Dictionary subscript, unsuccessful lookups", - "OrderedDictionary subscript, successful lookups", - "OrderedDictionary subscript, unsuccessful lookups", - ] - }, - { - "kind": "chart", - "title": "subscript setter, simple", - "tasks": [ - "Dictionary subscript, noop setter", - "Dictionary subscript, set existing", - "Dictionary subscript, _modify", - "OrderedDictionary subscript, noop setter", - "OrderedDictionary subscript, set existing", - "OrderedDictionary subscript, _modify", - ] - }, - { - "kind": "chart", - "title": "subscript insert/append", - "tasks": [ - "Dictionary subscript, insert", - "Dictionary subscript, insert, reserving capacity", - "OrderedDictionary subscript, append", - "OrderedDictionary subscript, append, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "subscript remove", - "tasks": [ - "Dictionary subscript, remove existing", - "Dictionary subscript, remove missing", - "OrderedDictionary subscript, remove existing", - "OrderedDictionary subscript, remove missing", - ] - }, - ] - }, - { - "kind": "variants", - "charts": [ - { - "kind": "chart", - "title": "defaulted subscript lookups", - "tasks": [ - "Dictionary defaulted subscript, successful lookups", - "Dictionary defaulted subscript, unsuccessful lookups", - "OrderedDictionary defaulted subscript, successful lookups", - "OrderedDictionary defaulted subscript, unsuccessful lookups", - ] - }, - { - "kind": "chart", - "title": "defaulted subscript mutations", - "tasks": [ - "Dictionary defaulted subscript, _modify existing", - "Dictionary defaulted subscript, _modify missing", - "OrderedDictionary defaulted subscript, _modify existing", - "OrderedDictionary defaulted subscript, _modify missing", - ] - }, - ] - }, - { - "kind": "chart", - "title": "updateValue(_:forKey:)", - "tasks": [ - "Dictionary updateValue(_:forKey:), existing", - "Dictionary updateValue(_:forKey:), insert", - "OrderedDictionary updateValue(_:forKey:), existing", - "OrderedDictionary updateValue(_:forKey:), append", - ] - }, - ] - }, - ] - }, - { - "kind": "group", - "title": "Against containers in the C++ Standard Template Library", - "directory": "stl", - "contents": [ - { - "kind": "chart", - "title": "Hashing", - "tasks": [ - "std::hash", - "custom_intptr_hash (using Swift.Hasher)", - "Hasher.combine on a single buffer of integers", - "Int.hashValue on each value", - ] - }, - { - "kind": "group", - "title": "Array vs std::vector", - "directory": "Array + vector", - "contents": [ - { - "kind": "chart", - "title": "init from buffer of integers", - "tasks": [ - "std::vector constructor from buffer", - "Array init from unsafe buffer", - ] - }, - { - "kind": "chart", - "title": "sequential iteration", - "tasks": [ - "std::vector sequential iteration", - "Array sequential iteration", - ] - }, - { - "kind": "chart", - "title": "random-access offset lookups", - "tasks": [ - "std::vector random-access offset lookups (operator [])", - "std::vector random-access offset lookups (at)", - "Array subscript get, random offsets", - ] - }, - { - "kind": "chart", - "title": "append individual integers", - "tasks": [ - "std::vector push_back", - "std::vector push_back, reserving capacity", - "Array append", - "Array append, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "prepend individual integers", - "tasks": [ - "std::vector insert at front", - "std::vector insert at front, reserving capacity", - "Array prepend", - "Array prepend, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "random insertions", - "tasks": [ - "std::vector random insertions", - "Array random insertions", - ] - }, - { - "kind": "chart", - "title": "removeFirst", - "tasks": [ - "std::vector erase first", - "Array removeFirst", - ] - }, - { - "kind": "chart", - "title": "removeLast", - "tasks": [ - "std::vector pop_back", - "Array removeLast", - ] - }, - { - "kind": "chart", - "title": "random removals", - "tasks": [ - "std::vector random removals", - "Array random removals", - ] - }, - { - "kind": "chart", - "title": "sort", - "tasks": [ - "std::vector sort", - "Array sort", - ] - }, - ] - }, - { - "kind": "group", - "title": "Deque vs std::deque", - "directory": "Deque + deque", - "contents": [ - { - "kind": "chart", - "title": "init from buffer of integers", - "tasks": [ - "std::deque constructor from buffer", - "Deque init from unsafe buffer", - ] - }, - { - "kind": "chart", - "title": "sequential iteration", - "tasks": [ - "std::deque sequential iteration", - "Deque sequential iteration (contiguous)", - "Deque sequential iteration (discontiguous)", - ] - }, - { - "kind": "chart", - "title": "random-access offset lookups", - "tasks": [ - "std::deque random-access offset lookups (operator [])", - "std::deque at, random offsets", - "Deque subscript get, random offsets (contiguous)", - "Deque subscript get, random offsets (discontiguous)", - ] - }, - { - "kind": "chart", - "title": "append individual integers", - "tasks": [ - "std::deque push_back", - "Deque append", - "Deque append, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "prepend individual integers", - "tasks": [ - "std::deque push_front", - "Deque prepend", - "Deque prepend, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "random insertions", - "tasks": [ - "std::deque random insertions", - "Deque random insertions", - ] - }, - { - "kind": "chart", - "title": "removeFirst", - "tasks": [ - "std::deque pop_front", - "Deque removeFirst (contiguous)", - "Deque removeFirst (discontiguous)", - ] - }, - { - "kind": "chart", - "title": "removeLast", - "tasks": [ - "std::deque pop_back", - "Deque removeLast (contiguous)", - "Deque removeLast (discontiguous)", - ] - }, - { - "kind": "chart", - "title": "random removals", - "tasks": [ - "std::deque random removals", - "Deque random removals (contiguous)", - "Deque random removals (discontiguous)", - ] - }, - { - "kind": "chart", - "title": "sort", - "tasks": [ - "std::deque sort", - "Deque sort (contiguous)", - "Deque sort (discontiguous)", - ] - }, - ] - }, - { - "kind": "group", - "title": "Set vs std::unordered_set", - "directory": "Set + unordered_set", - "contents": [ - { - "kind": "chart", - "title": "init from integer range", - "tasks": [ - "std::unordered_set insert from integer range", - "Set init from range", - ] - }, - { - "kind": "chart", - "title": "init from buffer of integers", - "tasks": [ - "std::unordered_set constructor from buffer", - "Set init from unsafe buffer", - ] - }, - { - "kind": "chart", - "title": "sequential iteration", - "tasks": [ - "std::unordered_set sequential iteration", - "Set sequential iteration", - ] - }, - { - "kind": "chart", - "title": "successful lookups", - "tasks": [ - "std::unordered_set successful find", - "Set successful contains", - ] - }, - { - "kind": "chart", - "title": "unsuccessful lookups", - "tasks": [ - "std::unordered_set unsuccessful find", - "Set unsuccessful contains", - ] - }, - { - "kind": "chart", - "title": "random insertions", - "tasks": [ - "std::unordered_set insert", - "std::unordered_set insert, reserving capacity", - "Set insert", - "Set insert, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "random removals", - "tasks": [ - "std::unordered_set erase", - "Set remove", - ] - }, - ] - }, - { - "kind": "group", - "title": "OrderedSet vs std::unordered_set", - "directory": "OrderedSet + unordered_set", - "contents": [ - { - "kind": "chart", - "title": "init from integer range", - "tasks": [ - "std::unordered_set insert from integer range", - "Set init from range", - "OrderedSet init from range", - ] - }, - { - "kind": "chart", - "title": "init from buffer of integers", - "tasks": [ - "std::unordered_set constructor from buffer", - "Set init from unsafe buffer", - "OrderedSet init from unsafe buffer", - ] - }, - { - "kind": "chart", - "title": "sequential iteration", - "tasks": [ - "std::unordered_set sequential iteration", - "Set sequential iteration", - "OrderedSet sequential iteration", - ] - }, - { - "kind": "chart", - "title": "successful lookups", - "tasks": [ - "std::unordered_set successful find", - "OrderedSet successful contains", - "Set successful contains", - ] - }, - { - "kind": "chart", - "title": "unsuccessful lookups", - "tasks": [ - "std::unordered_set unsuccessful find", - "OrderedSet unsuccessful contains", - "Set unsuccessful contains", - ] - }, - { - "kind": "chart", - "title": "insertions", - "tasks": [ - "std::unordered_set insert", - "Set insert", - "OrderedSet append", - ] - }, - { - "kind": "chart", - "title": "insertions, reserving capacity", - "tasks": [ - "std::unordered_set insert, reserving capacity", - "Set insert, reserving capacity", - "OrderedSet append, reserving capacity", - ] - }, - { - "kind": "chart", - "title": "random removals", - "tasks": [ - "std::unordered_set erase", - "Set remove", - "OrderedSet remove", - ] - }, - ] - }, - { - "kind": "group", - "title": "OrderedDictionary vs std::unordered_map", - "directory": "OrderedDictionary + unordered_map", - "contents": [ - { - "kind": "chart", - "title": "initializers", - "tasks": [ - "std::unordered_map insert", - "Dictionary init(uniqueKeysWithValues:)", - "OrderedDictionary init(uniqueKeysWithValues:)", - "OrderedDictionary init(uncheckedUniqueKeysWithValues:)", - "OrderedDictionary init(uncheckedUniqueKeys:values:)", - ] - }, - { - "kind": "chart", - "title": "iteration", - "tasks": [ - "std::unordered_map sequential iteration", - "Dictionary sequential iteration", - "OrderedDictionary sequential iteration", - ] - }, - { - "kind": "chart", - "title": "successful find index", - "tasks": [ - "std::unordered_map successful find", - "OrderedDictionary successful index(forKey:)", - "Dictionary successful index(forKey:)", - "Int.hashValue on each value", - ] - }, - { - "kind": "chart", - "title": "unsuccessful find index", - "tasks": [ - "std::unordered_map unsuccessful find", - "OrderedDictionary unsuccessful index(forKey:)", - "Dictionary unsuccessful index(forKey:)", - "Int.hashValue on each value", - ] - }, - { - "kind": "chart", - "title": "defaulted subscript, existing key", - "tasks": [ - "std::unordered_map subscript, existing key", - "OrderedDictionary defaulted subscript, _modify existing", - "Dictionary defaulted subscript, _modify existing", - "Int.hashValue on each value", - ] - }, - { - "kind": "chart", - "title": "defaulted subscript, new key", - "tasks": [ - "std::unordered_map subscript, new key", - "OrderedDictionary defaulted subscript, _modify missing", - "Dictionary defaulted subscript, _modify missing", - "Int.hashValue on each value", - ] - }, - { - "kind": "chart", - "title": "insert", - "tasks": [ - "std::unordered_map insert", - "OrderedDictionary subscript, append", - "Dictionary subscript, insert", - "Int.hashValue on each value", - ] - }, - { - "kind": "chart", - "title": "insert, reserving capacity", - "tasks": [ - "std::unordered_map insert, reserving capacity", - "OrderedDictionary subscript, append, reserving capacity", - "Dictionary subscript, insert, reserving capacity", - "Int.hashValue on each value", - ] - }, - { - "kind": "chart", - "title": "removing existing elements", - "tasks": [ - "std::unordered_map erase existing", - "OrderedDictionary subscript, remove existing", - "Dictionary subscript, remove existing", - ] - }, - { - "kind": "chart", - "title": "removing missing elements", - "tasks": [ - "std::unordered_map erase missing", - "OrderedDictionary subscript, remove missing", - "Dictionary subscript, remove missing", - ] - }, - ] - }, - { - "kind": "group", - "title": "Heap vs std::priority_queue", - "directory": "Heap + priority_queue", - "contents": [ - { - "kind": "chart", - "title": "initializers", - "tasks": [ - "std::priority_queue construct from buffer", - "Heap init from buffer", - ] - }, - { - "kind": "chart", - "title": "insert", - "tasks": [ - "std::priority_queue push", - "CFBinaryHeapAddValue", - "Heap insert" - ] - }, - { - "kind": "chart", - "title": "pop", - "tasks": [ - "std::priority_queue pop", - "CFBinaryHeapRemoveMinimumValue", - "Heap popMin", - "Heap popMax" - ] - }, - ] - } - ] - }, - ] -} diff --git a/Benchmarks/Sources/Benchmarks/Library.swift b/Benchmarks/Sources/Benchmarks/Library.swift deleted file mode 100644 index 44b6818e..00000000 --- a/Benchmarks/Sources/Benchmarks/Library.swift +++ /dev/null @@ -1,20 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Swift Collections open source project -// -// Copyright (c) 2021 Apple Inc. and the Swift project authors -// Licensed under Apache License v2.0 with Runtime Library Exception -// -// See https://swift.org/LICENSE.txt for license information -// -//===----------------------------------------------------------------------===// - -import Foundation -import CollectionsBenchmark - -extension Benchmark { - public func loadReferenceLibrary() throws -> ChartLibrary { - let url = Bundle.module.url(forResource: "Library", withExtension: "json")! - return try ChartLibrary.load(from: url) - } -} diff --git a/Benchmarks/Sources/benchmark-tool/main.swift b/Benchmarks/Sources/benchmark-tool/main.swift index fa89957d..333311a8 100644 --- a/Benchmarks/Sources/benchmark-tool/main.swift +++ b/Benchmarks/Sources/benchmark-tool/main.swift @@ -41,6 +41,4 @@ benchmark.addCppBenchmarks() benchmark.addFoundationBenchmarks() #endif -benchmark.chartLibrary = try benchmark.loadReferenceLibrary() - benchmark.main()