Skip to content

Commit 9919bc7

Browse files
committed
[benchmark] Remove Array.[init/append] & dead code
1 parent 626878e commit 9919bc7

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

benchmark/single-source/DataBenchmarks.swift

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,6 @@ public let DataBenchmarks = [
7878
_init($0, sequence: Bytes(count: 2<<15, exact: true)) }, tags: d),
7979
BenchmarkInfo(name: "Data.init.Sequence.64kB.Count0", runFunction: {
8080
_init($0, sequence: Bytes(count: 2<<15, exact: false)) }, tags: d),
81-
BenchmarkInfo(name: "Array.init.Sequence.64kB.Count.I", runFunction: {
82-
for _ in 1...$0 {
83-
blackHole(Array(Bytes(count: 2<<15, exact: true))) } }, tags: d),
84-
BenchmarkInfo(name: "Array.init.Sequence.64kB.Count0.I", runFunction: {
85-
for _ in 1...$0 {
86-
blackHole(Array(Bytes(count: 2<<15, exact: false))) } }, tags: d),
87-
BenchmarkInfo(name: "Array.init.Sequence.64kB.Count.RE.I", runFunction: {
88-
for _ in 1...$0 {
89-
blackHole(Array(repeatElement(UInt8(0xA0), count: 2<<15))) } }, tags: d),
90-
BenchmarkInfo(name: "Array.init.Sequence.64kB.Count0.RE.I", runFunction: {
91-
for _ in 1...$0 {
92-
blackHole(Array(Count0(repeatElement(UInt8(0xA0), count: 2<<15)))) } },
93-
tags: d),
9481
BenchmarkInfo(name: "Data.init.Sequence.64kB.Count.I", runFunction: {
9582
for _ in 0..<$0 {
9683
blackHole(Data(Bytes(count: 2<<15, exact: true))) } }, tags: d),
@@ -215,20 +202,6 @@ public let DataBenchmarks = [
215202
BenchmarkInfo(name: "Data.append.Sequence.64kB.Count0", runFunction: {
216203
append($0, sequence: Bytes(count: 2<<15, exact: false), to: medium) },
217204
tags: d),
218-
BenchmarkInfo(name: "Array.append.Sequence.64kB.Count.I", runFunction: {
219-
for _ in 1...$0 { var copy = mediumArray
220-
copy.append(contentsOf: Bytes(count: 2<<15, exact: true)) } }, tags: d),
221-
BenchmarkInfo(name: "Array.append.Sequence.64kB.Count0.I", runFunction: {
222-
for _ in 1...$0 { var copy = mediumArray
223-
copy.append(contentsOf: Bytes(count: 2<<15, exact: false)) } }, tags: d),
224-
BenchmarkInfo(name: "Array.append.Sequence.64kB.Count.RE.I", runFunction: {
225-
for _ in 1...$0 { var copy = mediumArray
226-
copy.append(contentsOf: repeatElement(UInt8(0xA0), count: 2<<15)) } },
227-
tags: d),
228-
BenchmarkInfo(name: "Array.append.Sequence.64kB.Count0.RE.I", runFunction: {
229-
for _ in 1...$0 { var copy = mediumArray
230-
copy.append(contentsOf: Count0(repeatElement(UInt8(0xA0), count: 2<<15)))
231-
} }, tags: d),
232205
BenchmarkInfo(name: "Data.append.Sequence.64kB.Count.I", runFunction: {
233206
for _ in 1...$0 { var copy = medium
234207
copy.append(contentsOf: Bytes(count: 2<<15, exact: true)) } }, tags: d),
@@ -331,14 +304,6 @@ let small = sampleData(.small)
331304
let medium = sampleData(.medium)
332305
let large = sampleData(.large)
333306

334-
let mediumArray: [UInt8] = (1...1033).map { UInt8(truncatingIfNeeded: $0) }
335-
336-
let repeatElementSeq = { count in
337-
return sequence(state: count) { (i: inout Int) -> UInt8? in
338-
defer { i = i &- 1 }; return i > 0 ? UInt8(0xA0) : nil
339-
}
340-
}
341-
342307
struct Count0<S: Sequence> : Sequence {
343308
let base: S
344309
init (_ base:S) { self.base = base }

0 commit comments

Comments
 (0)