Skip to content

Commit cbb1678

Browse files
committed
Remove new string interpolation benchmarks
They will return, probably in a separate pull request; I just want to see how much they're inflating StringInterpolation.o's code size.
1 parent 141be4a commit cbb1678

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

benchmark/single-source/StringInterpolation.swift

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ public let StringInterpolationManySmallSegments = BenchmarkInfo(
2424
name: "StringInterpolationManySmallSegments",
2525
runFunction: run_StringInterpolationManySmallSegments,
2626
tags: [.validation, .api, .String])
27-
public let CustomStringInterpolation = BenchmarkInfo(
28-
name: "CustomStringInterpolation",
29-
runFunction: run_CustomStringInterpolation,
30-
tags: [.validation, .api, .String])
31-
public let CustomStringNoInterpolation = BenchmarkInfo(
32-
name: "CustomStringNoInterpolation",
33-
runFunction: run_CustomStringNoInterpolation,
34-
tags: [.validation, .api, .String])
3527

3628
class RefTypePrintable : CustomStringConvertible {
3729
var description: String {
@@ -120,49 +112,3 @@ public func run_StringInterpolationManySmallSegments(_ N: Int) {
120112
}
121113
}
122114
}
123-
124-
@inline(never)
125-
public func run_CustomStringInterpolation(_ N: Int) {
126-
let reps = 100
127-
let refResult = reps
128-
let anInt: Int64 = 0x1234567812345678
129-
let aRefCountedObject = RefTypePrintable()
130-
131-
for _ in 1...100*N {
132-
var result = 0
133-
for _ in 1...reps {
134-
let s: String = identity(CustomString(
135-
"\(anInt) abcdefdhijklmn \(aRefCountedObject) abcdefdhijklmn \u{01}")).value
136-
let utf16 = s.utf16
137-
138-
// FIXME: if String is not stored as UTF-16 on this platform, then the
139-
// following operation has a non-trivial cost and needs to be replaced
140-
// with an operation on the native storage type.
141-
result = result &+ Int(utf16.last!)
142-
blackHole(s)
143-
}
144-
CheckResults(result == refResult)
145-
}
146-
}
147-
148-
@inline(never)
149-
public func run_CustomStringNoInterpolation(_ N: Int) {
150-
let reps = 100
151-
let refResult = reps
152-
153-
for _ in 1...100*N {
154-
var result = 0
155-
for _ in 1...reps {
156-
let s: String = identity(CustomString(
157-
"abcdefdhijklmn abcdefdhijklmn \u{01}")).value
158-
let utf16 = s.utf16
159-
160-
// FIXME: if String is not stored as UTF-16 on this platform, then the
161-
// following operation has a non-trivial cost and needs to be replaced
162-
// with an operation on the native storage type.
163-
result = result &+ Int(utf16.last!)
164-
blackHole(s)
165-
}
166-
CheckResults(result == refResult)
167-
}
168-
}

benchmark/utils/main.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,6 @@ registerBenchmark(StringHashing)
315315
registerBenchmark(StringInterpolation)
316316
registerBenchmark(StringInterpolationSmall)
317317
registerBenchmark(StringInterpolationManySmallSegments)
318-
registerBenchmark(CustomStringInterpolation)
319-
registerBenchmark(CustomStringNoInterpolation)
320318
registerBenchmark(StringMatch)
321319
registerBenchmark(StringRemoveDupes)
322320
registerBenchmark(StringTests)

0 commit comments

Comments
 (0)