Skip to content

Commit e004cd3

Browse files
committed
Merge branch 'release/1.1' into merge.1.1→main
# Conflicts: # CMakeLists.txt # README.md
2 parents 133cc83 + 94cf62b commit e004cd3

File tree

492 files changed

+2095
-1480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

492 files changed

+2095
-1480
lines changed

Benchmarks/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:5.7
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the Swift Collections open source project
55
//
6-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
6+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
77
// Licensed under Apache License v2.0 with Runtime Library Exception
88
//
99
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/ArrayBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/BitsetBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppDequeBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppMapBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppPriorityQueueBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppUnorderedMapBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppUnorderedSetBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppVectorBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Cpp/CppVectorBoolBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/CustomGenerators.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2022 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/DequeBenchmarks.swift

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -510,5 +510,32 @@ extension Benchmark {
510510
blackHole(deque)
511511
}
512512
}
513+
514+
self.add(
515+
title: "Deque<Int> equality, unique",
516+
input: Int.self
517+
) { size in
518+
let left = Deque(0 ..< size)
519+
let right = Deque(0 ..< size)
520+
return { timer in
521+
timer.measure {
522+
precondition(left == right)
523+
}
524+
}
525+
}
526+
527+
self.add(
528+
title: "Deque<Int> equality, shared",
529+
input: Int.self
530+
) { size in
531+
let left = Deque(0 ..< size)
532+
let right = Deque(0 ..< size)
533+
return { timer in
534+
timer.measure {
535+
precondition(left == right)
536+
}
537+
}
538+
}
539+
513540
}
514541
}

Benchmarks/Sources/Benchmarks/DictionaryBenchmarks.swift

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -407,6 +407,34 @@ extension Benchmark {
407407
blackHole(d)
408408
}
409409
}
410-
410+
411+
self.add(
412+
title: "Dictionary<Int, Int> equality, unique",
413+
input: [Int].self
414+
) { input in
415+
let keysAndValues = input.map { ($0, 2 * $0) }
416+
let left = Dictionary(uniqueKeysWithValues: keysAndValues)
417+
let right = Dictionary(uniqueKeysWithValues: keysAndValues)
418+
return { timer in
419+
timer.measure {
420+
precondition(left == right)
421+
}
422+
}
423+
}
424+
425+
self.add(
426+
title: "Dictionary<Int, Int> equality, shared",
427+
input: [Int].self
428+
) { input in
429+
let keysAndValues = input.map { ($0, 2 * $0) }
430+
let left = Dictionary(uniqueKeysWithValues: keysAndValues)
431+
let right = left
432+
return { timer in
433+
timer.measure {
434+
precondition(left == right)
435+
}
436+
}
437+
}
438+
411439
}
412440
}

Benchmarks/Sources/Benchmarks/Foundation/CFBinaryHeapBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Foundation/CFBitVectorBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Foundation/FoundationBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/HeapBenchmarks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/Kalimba.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

Benchmarks/Sources/Benchmarks/OrderedDictionaryBenchmarks.swift

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -539,5 +539,62 @@ extension Benchmark {
539539
blackHole(d)
540540
}
541541
}
542+
543+
self.add(
544+
title: "OrderedDictionary<Int, Int> equality, unique",
545+
input: [Int].self
546+
) { input in
547+
let keysAndValues = input.map { ($0, 2 * $0) }
548+
let left = OrderedDictionary(uniqueKeysWithValues: keysAndValues)
549+
let right = OrderedDictionary(uniqueKeysWithValues: keysAndValues)
550+
return { timer in
551+
timer.measure {
552+
precondition(left == right)
553+
}
554+
}
555+
}
556+
557+
self.add(
558+
title: "OrderedDictionary<Int, Int> equality, shared",
559+
input: [Int].self
560+
) { input in
561+
let keysAndValues = input.map { ($0, 2 * $0) }
562+
let left = OrderedDictionary(uniqueKeysWithValues: keysAndValues)
563+
let right = left
564+
return { timer in
565+
timer.measure {
566+
precondition(left == right)
567+
}
568+
}
569+
}
570+
571+
self.add(
572+
title: "OrderedDictionary<Int, Int>.Values equality, unique",
573+
input: [Int].self
574+
) { input in
575+
let keysAndValues = input.map { ($0, 2 * $0) }
576+
let left = OrderedDictionary(uniqueKeysWithValues: keysAndValues)
577+
let right = OrderedDictionary(uniqueKeysWithValues: keysAndValues)
578+
return { timer in
579+
timer.measure {
580+
precondition(left.values == right.values)
581+
}
582+
}
583+
}
584+
585+
self.add(
586+
title: "OrderedDictionary<Int, Int>.Values equality, shared",
587+
input: [Int].self
588+
) { input in
589+
let keysAndValues = input.map { ($0, 2 * $0) }
590+
let left = OrderedDictionary(uniqueKeysWithValues: keysAndValues)
591+
let right = left
592+
return { timer in
593+
timer.measure {
594+
precondition(left.values == right.values)
595+
}
596+
}
597+
}
598+
542599
}
543600
}

Benchmarks/Sources/Benchmarks/OrderedSetBenchmarks.swift

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Collections open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -555,6 +555,58 @@ extension Benchmark {
555555
}
556556
}
557557
}
558+
559+
self.add(
560+
title: "OrderedSet<Int> equality, unique",
561+
input: Int.self
562+
) { size in
563+
return { timer in
564+
let left = OrderedSet(0 ..< size)
565+
let right = OrderedSet(0 ..< size)
566+
timer.measure {
567+
precondition(left == right)
568+
}
569+
}
570+
}
571+
572+
self.add(
573+
title: "OrderedSet<Int> equality, shared",
574+
input: Int.self
575+
) { size in
576+
return { timer in
577+
let left = OrderedSet(0 ..< size)
578+
let right = left
579+
timer.measure {
580+
precondition(left == right)
581+
}
582+
}
583+
}
584+
585+
self.add(
586+
title: "OrderedSet<Int>.SubSequence equality, unique",
587+
input: Int.self
588+
) { size in
589+
return { timer in
590+
let left = OrderedSet(0 ..< size)[0 ..< size]
591+
let right = OrderedSet(0 ..< size)[0 ..< size]
592+
timer.measure {
593+
precondition(left == right)
594+
}
595+
}
596+
}
597+
598+
self.add(
599+
title: "OrderedSet<Int>.SubSequence equality, shared",
600+
input: Int.self
601+
) { size in
602+
return { timer in
603+
let left = OrderedSet(0 ..< size)[0 ..< size]
604+
let right = left
605+
timer.measure {
606+
precondition(left == right)
607+
}
608+
}
609+
}
558610

559611
}
560612
}

0 commit comments

Comments
 (0)