Skip to content

Commit baa1e9e

Browse files
committed
Only measure mallocCountTotal in Benchmarks
Keeps `scalingFactor: .kilo`, but only measures `.mallocCountTotal`, as that should be a reproducible value across different systems.
1 parent 62ae8e2 commit baa1e9e

13 files changed

+15
-114
lines changed

Benchmarks/Benchmarks/SwiftKafkaConsumerBenchmarks/KafkaConsumerBenchmark.swift

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,12 @@ let benchmarks = {
3232

3333
Benchmark.defaultConfiguration = .init(
3434
metrics: [
35-
.wallClock,
36-
.cpuTotal,
37-
.contextSwitches,
38-
.throughput,
39-
.allocatedResidentMemory,
40-
] + .arc,
35+
.mallocCountTotal,
36+
],
4137
// We need to tell the benchmarking framework how often we are running the benchmark.
4238
scalingFactor: .kilo,
4339
maxDuration: .seconds(10_000_000),
44-
maxIterations: 10,
45-
thresholds: [
46-
.wallClock: .init(relative: [.p90: 35]),
47-
.cpuTotal: .init(relative: [.p90: 35]),
48-
.allocatedResidentMemory: .init(relative: [.p90: 20]),
49-
.contextSwitches: .init(relative: [.p90: 35]),
50-
.throughput: .init(relative: [.p90: 35]),
51-
.objectAllocCount: .init(relative: [.p90: 20]),
52-
.retainCount: .init(relative: [.p90: 20]),
53-
.releaseCount: .init(relative: [.p90: 20]),
54-
.retainReleaseDelta: .init(relative: [.p90: 20]),
55-
]
40+
maxIterations: 10
5641
)
5742

5843
Benchmark.setup = {
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 562561023,
3-
"cpuTotal" : 210108415,
4-
"objectAllocCount" : 5971,
5-
"releaseCount" : 17775,
6-
"retainCount" : 9638,
7-
"retainReleaseDelta" : 2175,
8-
"throughput" : 2,
9-
"wallClock" : 638582783
2+
"mallocCountTotal" : 42079
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 554172415,
3-
"cpuTotal" : 170000000,
4-
"objectAllocCount" : 6991,
5-
"releaseCount" : 19823,
6-
"retainCount" : 10655,
7-
"retainReleaseDelta" : 2185,
8-
"throughput" : 2,
9-
"wallClock" : 629669887
2+
"mallocCountTotal" : 59647
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 190971903,
3-
"cpuTotal" : 460000000,
4-
"objectAllocCount" : 16,
5-
"releaseCount" : 48,
6-
"retainCount" : 2,
7-
"retainReleaseDelta" : 30,
8-
"throughput" : 1,
9-
"wallClock" : 1870163542
2+
"mallocCountTotal" : 1000959
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 574619647,
3-
"cpuTotal" : 240000000,
4-
"objectAllocCount" : 5907,
5-
"releaseCount" : 16639,
6-
"retainCount" : 8591,
7-
"retainReleaseDelta" : 2135,
8-
"throughput" : 2,
9-
"wallClock" : 647495679
2+
"mallocCountTotal" : 29935
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 551026687,
3-
"cpuTotal" : 180092927,
4-
"objectAllocCount" : 7011,
5-
"releaseCount" : 18865,
6-
"retainCount" : 9668,
7-
"retainReleaseDelta" : 2187,
8-
"throughput" : 2,
9-
"wallClock" : 639631359
2+
"mallocCountTotal" : 49983
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 265158655,
3-
"cpuTotal" : 490209279,
4-
"objectAllocCount" : 16,
5-
"releaseCount" : 52,
6-
"retainCount" : 2,
7-
"retainReleaseDelta" : 34,
8-
"throughput" : 1,
9-
"wallClock" : 1876951039
2+
"mallocCountTotal" : 1000959
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 566231039,
3-
"cpuTotal" : 200015871,
4-
"objectAllocCount" : 5431,
5-
"releaseCount" : 18687,
6-
"retainCount" : 10863,
7-
"retainReleaseDelta" : 2415,
8-
"throughput" : 2,
9-
"wallClock" : 649592831
2+
"mallocCountTotal" : 31695
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 533725183,
3-
"cpuTotal" : 180092927,
4-
"objectAllocCount" : 6447,
5-
"releaseCount" : 21743,
6-
"retainCount" : 12895,
7-
"retainReleaseDelta" : 2417,
8-
"throughput" : 2,
9-
"wallClock" : 639107071
2+
"mallocCountTotal" : 56831
103
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"allocatedResidentMemory" : 565706751,
3-
"cpuTotal" : 450101247,
4-
"objectAllocCount" : 16,
5-
"releaseCount" : 40,
6-
"retainCount" : 2,
7-
"retainReleaseDelta" : 22,
8-
"throughput" : 1,
9-
"wallClock" : 1858076671
2+
"mallocCountTotal" : 1000959
103
}

0 commit comments

Comments
 (0)