@@ -67,6 +67,15 @@ let benchmarks = {
67
67
return box
68
68
} )
69
69
70
+ Benchmark ( " DataIdenticalEmpty " , closure: { benchmark, box in
71
+ blackHole ( box. d1. isIdentical ( to: box. d2) )
72
+ } , setup: { ( ) -> TwoDatasBox in
73
+ let d1 = Data ( )
74
+ let d2 = d1
75
+ let box = TwoDatasBox ( d1: d1, d2: d2)
76
+ return box
77
+ } )
78
+
70
79
Benchmark ( " DataEqualInline " , closure: { benchmark, box in
71
80
blackHole ( box. d1 == box. d2)
72
81
} , setup: { ( ) -> TwoDatasBox in
@@ -75,6 +84,15 @@ let benchmarks = {
75
84
let box = TwoDatasBox ( d1: d1, d2: d2)
76
85
return box
77
86
} )
87
+
88
+ Benchmark ( " DataIdenticalInline " , closure: { benchmark, box in
89
+ blackHole ( box. d1. isIdentical ( to: box. d2) )
90
+ } , setup: { ( ) -> TwoDatasBox in
91
+ let d1 = createSomeData ( 12 ) // Less than size of InlineData.Buffer
92
+ let d2 = d1
93
+ let box = TwoDatasBox ( d1: d1, d2: d2)
94
+ return box
95
+ } )
78
96
79
97
Benchmark ( " DataNotEqualInline " , closure: { benchmark, box in
80
98
blackHole ( box. d1 != box. d2)
@@ -93,7 +111,16 @@ let benchmarks = {
93
111
let box = TwoDatasBox ( d1: d1, d2: d2)
94
112
return box
95
113
} )
96
-
114
+
115
+ Benchmark ( " DataIdenticalLarge " , closure: { benchmark, box in
116
+ blackHole ( box. d1. isIdentical ( to: box. d2) )
117
+ } , setup: { ( ) -> TwoDatasBox in
118
+ let d1 = createSomeData ( 1024 * 8 )
119
+ let d2 = d1
120
+ let box = TwoDatasBox ( d1: d1, d2: d2)
121
+ return box
122
+ } )
123
+
97
124
Benchmark ( " DataNotEqualLarge " , closure: { benchmark, box in
98
125
blackHole ( box. d1 != box. d2)
99
126
} , setup: { ( ) -> TwoDatasBox in
@@ -112,6 +139,15 @@ let benchmarks = {
112
139
return box
113
140
} )
114
141
142
+ Benchmark ( " DataIdenticalReallyLarge " , closure: { benchmark, box in
143
+ blackHole ( box. d1. isIdentical ( to: box. d2) )
144
+ } , setup: { ( ) -> TwoDatasBox in
145
+ let d1 = createSomeData ( 1024 * 1024 * 8 )
146
+ let d2 = d1
147
+ let box = TwoDatasBox ( d1: d1, d2: d2)
148
+ return box
149
+ } )
150
+
115
151
Benchmark ( " DataNotEqualReallyLarge " , closure: { benchmark, box in
116
152
blackHole ( box. d1 != box. d2)
117
153
} , setup: { ( ) -> TwoDatasBox in
0 commit comments