Skip to content

Commit

Permalink
updating dependencies, code aligned with that, and re-running benchma…
Browse files Browse the repository at this point in the history
…rks (#43)
  • Loading branch information
heckj authored Oct 1, 2024
1 parent 9ad6336 commit 3225f92
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 74 deletions.
Binary file modified Benchmarks/Results/01 GSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Benchmarks/Results/02 ORSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Benchmarks/Results/03 ORMap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Benchmarks/Results/06 List append and insertion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Benchmarks/results.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -160,30 +160,32 @@ func parseJSONIntoTrace(topOfTrace: JSONValue) async -> Trace {

@_dynamicReplacement(for: registerBenchmarks) // And this is how we register our benchmarks
func benchmarks() {
Benchmark.defaultConfiguration.desiredIterations = .count(300)
Benchmark.defaultConfiguration.desiredDuration = .seconds(5)
Benchmark.defaultConfiguration.maxIterations = .count(300)
Benchmark.defaultConfiguration.maxDuration = .seconds(5)

// Benchmark("Loading JSON trace data",
// configuration: .init(metrics: [.throughput, .wallClock], desiredIterations: 20)) { benchmark in
// for _ in benchmark.throughputIterations {
// blackHole(await loadEditingTrace())
// }
// }
//
// Benchmark("parse JSON with Swift Extras parser",
// configuration: .init(metrics: [.throughput, .wallClock], desiredIterations: 50)) { benchmark in
// for _ in benchmark.throughputIterations {
// let data = await loadEditingTrace()
// benchmark.startMeasurement()
// blackHole(await parseDataIntoJSON(data: data))
// benchmark.stopMeasurement()
// }
// }
Benchmark("Loading JSON trace data",
configuration: .init(metrics: [.throughput, .wallClock]))
{ benchmark in
for _ in benchmark.scaledIterations {
await blackHole(loadEditingTrace())
}
}

Benchmark("parse JSON with Swift Extras parser",
configuration: .init(metrics: [.throughput, .wallClock]))
{ benchmark in
for _ in benchmark.scaledIterations {
let data = await loadEditingTrace()
benchmark.startMeasurement()
await blackHole(parseDataIntoJSON(data: data))
benchmark.stopMeasurement()
}
}

Benchmark("Custom parse JSON into trace",
configuration: .init(metrics: [.throughput, .wallClock]))
{ benchmark in
for _ in benchmark.throughputIterations {
for _ in benchmark.scaledIterations {
let data = await loadEditingTrace()
let jsonValue = await parseDataIntoJSON(data: data)
benchmark.startMeasurement()
Expand All @@ -195,7 +197,7 @@ func benchmarks() {
Benchmark("Foundation decode JSON into trace",
configuration: .init(metrics: [.throughput, .wallClock]))
{ benchmark in
for _ in benchmark.throughputIterations {
for _ in benchmark.scaledIterations {
let data = await loadEditingTrace()
benchmark.startMeasurement()
await blackHole(decodeIntoTrace(data: data))
Expand All @@ -206,7 +208,7 @@ func benchmarks() {
Benchmark("ExtrasJSON decode JSON into trace",
configuration: .init(metrics: [.throughput, .wallClock]))
{ benchmark in
for _ in benchmark.throughputIterations {
for _ in benchmark.scaledIterations {
let data = await loadEditingTrace()
benchmark.startMeasurement()
await blackHole(decodeXIntoTrace(data: data))
Expand All @@ -217,41 +219,44 @@ func benchmarks() {
Benchmark("ZippyJSON decode JSON into trace",
configuration: .init(metrics: [.throughput, .wallClock]))
{ benchmark in
for _ in benchmark.throughputIterations {
for _ in benchmark.scaledIterations {
let data = await loadEditingTrace()
benchmark.startMeasurement()
await blackHole(decodeZIntoTrace(data: data))
benchmark.stopMeasurement()
}
}

// Benchmark("Create single-character List CRDT",
// configuration: .init(metrics: BenchmarkMetric.all, throughputScalingFactor: .kilo)) { benchmark in
// for _ in benchmark.throughputIterations {
// blackHole(blackHole(List(actorId: "a", ["a"])))
// }
// }
//
// Benchmark("List six-character append",
// configuration: .init(metrics: [.throughput, .wallClock], throughputScalingFactor: .kilo)) { benchmark in
// for _ in benchmark.throughputIterations {
// var mylist = List(actorId: "a", ["a"])
// benchmark.startMeasurement()
// mylist.append(" hello")
// benchmark.stopMeasurement()
// }
// }
//
// Benchmark("List six-character append, individual characters",
// configuration: .init(metrics: [.throughput, .wallClock], throughputScalingFactor: .kilo)) { benchmark in
// for _ in benchmark.throughputIterations {
// var mylist = List(actorId: "a", ["a"])
// let appendList = [" ", "h", "e", "l", "l", "o"]
// benchmark.startMeasurement()
// for val in appendList {
// mylist.append(val)
// }
// benchmark.stopMeasurement()
// }
// }
Benchmark("Create single-character List CRDT",
configuration: .init(metrics: BenchmarkMetric.all, scalingFactor: .kilo))
{ benchmark in
for _ in benchmark.scaledIterations {
blackHole(blackHole(List(actorId: "a", ["a"])))
}
}

Benchmark("List six-character append",
configuration: .init(metrics: [.throughput, .wallClock], scalingFactor: .kilo))
{ benchmark in
for _ in benchmark.scaledIterations {
var mylist = List(actorId: "a", ["a"])
benchmark.startMeasurement()
mylist.append(" hello")
benchmark.stopMeasurement()
}
}

Benchmark("List six-character append, individual characters",
configuration: .init(metrics: [.throughput, .wallClock], scalingFactor: .kilo))
{ benchmark in
for _ in benchmark.scaledIterations {
var mylist = List(actorId: "a", ["a"])
let appendList = [" ", "h", "e", "l", "l", "o"]
benchmark.startMeasurement()
for val in appendList {
mylist.append(val)
}
benchmark.stopMeasurement()
}
}
}
39 changes: 24 additions & 15 deletions ExternalBenchmarks/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/michaeleisel/JJLISO8601DateFormatter",
"state" : {
"revision" : "de422afd9a47b72703c30a81423c478337191390",
"version" : "0.1.6"
"revision" : "741a9e45db01148a8ac60c5e12f7c978181a22d3",
"version" : "0.1.8"
}
},
{
"identity" : "package-benchmark",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ordo-one/package-benchmark",
"state" : {
"revision" : "81bd87b4eca4c1fff0275fa55fd52b1faf3814d9",
"version" : "0.8.0"
"revision" : "3b3d46ee240a886d8987938d0c563874e04feeda",
"version" : "0.9.0"
}
},
{
Expand All @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/ordo-one/package-histogram",
"state" : {
"revision" : "604410b21ded1ebdf06ad98100f448c68e80f5a1",
"version" : "0.1.1"
"revision" : "a69fa24d7b70421870cafa86340ece900489e17e",
"version" : "0.1.2"
}
},
{
Expand All @@ -45,13 +45,22 @@
"version" : "1.0.0"
}
},
{
"identity" : "progress.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ordo-one/Progress.swift",
"state" : {
"revision" : "29dc5dc29d8408f42878b832c7aae38a35ff26ee",
"version" : "1.0.3"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
"version" : "1.2.2"
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
Expand All @@ -66,7 +75,7 @@
{
"identity" : "swift-extras-json",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-extras/swift-extras-json",
"location" : "https://github.com/swift-extras/swift-extras-json.git",
"state" : {
"revision" : "122b9454ef01bf89a4c190b8fd3717ddd0a2fbd0",
"version" : "0.6.0"
Expand All @@ -86,8 +95,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system",
"state" : {
"revision" : "025bcb1165deab2e20d4eaba79967ce73013f496",
"version" : "1.2.1"
"revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5",
"version" : "1.3.2"
}
},
{
Expand All @@ -104,17 +113,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/michaeleisel/ZippyJSON.git",
"state" : {
"revision" : "c4ab804780b64979f19268619dfa563b6be58f7d",
"version" : "1.2.10"
"revision" : "ddbbc024ba5a826f9676035a0a090a0bc2d40755",
"version" : "1.2.15"
}
},
{
"identity" : "zippyjsoncfamily",
"kind" : "remoteSourceControl",
"location" : "https://github.com/michaeleisel/ZippyJSONCFamily",
"state" : {
"revision" : "8abdd7a5e943afe68e7b03fdaa63b21c042a3893",
"version" : "1.2.9"
"revision" : "c1c0f88977359ea85b81e128b2d988e8250dfdae",
"version" : "1.2.14"
}
}
],
Expand Down
14 changes: 7 additions & 7 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version" : "1.4.0"
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
Expand All @@ -23,14 +23,14 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
"revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64",
"version" : "1.4.3"
}
},
{
"identity" : "swift-docc-symbolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-symbolkit",
"location" : "https://github.com/swiftlang/swift-docc-symbolkit",
"state" : {
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
"version" : "1.0.0"
Expand All @@ -41,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system",
"state" : {
"revision" : "6a9e38e7bd22a3b8ba80bddf395623cf68f57807",
"version" : "1.3.1"
"revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5",
"version" : "1.3.2"
}
}
],
Expand Down

0 comments on commit 3225f92

Please sign in to comment.