Skip to content

Commit

Permalink
Revert "Add a benchmark for unicode Strings created via JSON decoding"
Browse files Browse the repository at this point in the history
DougGregor authored Jun 26, 2019
1 parent 10aa1a7 commit 78ef7e3
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions benchmark/single-source/ObjectiveCBridging.swift
Original file line number Diff line number Diff line change
@@ -76,9 +76,6 @@ public let ObjectiveCBridging = [
BenchmarkInfo(name: "ObjectiveCBridgeASCIIStringFromFile",
runFunction: run_ASCIIStringFromFile, tags: ts,
setUpFunction: setup_ASCIIStringFromFile),
BenchmarkInfo(name: "UnicodeStringFromCodable",
runFunction: run_UnicodeStringFromCodable, tags: ts,
setUpFunction: setup_UnicodeStringFromCodable),
]

#if _runtime(_ObjC)
@@ -747,25 +744,3 @@ public func run_ASCIIStringFromFile(_ N: Int) {
#endif
}

var unicodeStringFromCodable:String? = nil
var unicodeStringFromCodableDict = [String:Void]()
public func setup_UnicodeStringFromCodable() {
let jsonString = "[\(String(reflecting: string))]"

let decoded = try JSONDecoder().decode([String].self, from: Data(jsonString.utf8))
let reEncoded = try JSONEncoder().encode(decoded)
let desc = try JSONDecoder().decode([String].self, from: reEncoded)

unicodeStringFromCodable = desc[0]
}

@inline(never)
public func run_UnicodeStringFromCodable(_ N: Int) {
#if _runtime(_ObjC)
for _ in 0 ..< N {
for _ in 0..<100 {
unicodeStringFromCodableDict[identity(unicodeStringFromCodable)] = ()
}
}
#endif
}

0 comments on commit 78ef7e3

Please sign in to comment.