Skip to content

Commit b48c22d

Browse files
committed
update thresholds
1 parent e35811c commit b48c22d

8 files changed

+13
-49
lines changed

Benchmarks/Parser/Parser.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@ import MultipartKit
44
// Note: the throughput benchmarks use streams which yield with a delay
55
// to simulate async work.
66
let benchmarks: @Sendable () -> Void = {
7-
Benchmark.defaultConfiguration = .init(
8-
metrics: [.peakMemoryResident, .mallocCountTotal],
9-
thresholds: [
10-
.peakMemoryResident: .init(
11-
/// Tolerate up to 2% of difference compared to the threshold.
12-
relative: [.p90: 2],
13-
/// Tolerate up to one million bytes of difference compared to the threshold.
14-
absolute: [.p90: 1_100_000]
15-
),
16-
.mallocCountTotal: .init(
17-
/// Tolerate up to 1% of difference compared to the threshold.
18-
relative: [.p90: 1],
19-
/// Tolerate up to 2 malloc calls of difference compared to the threshold.
20-
absolute: [.p90: 2]
21-
),
22-
]
23-
)
24-
257
Benchmark(
268
"Streaming Parser Allocations",
279
configuration: .init(

Benchmarks/Serializer/Serializer.swift

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ let example: MultipartPart = .init(
1010
)
1111

1212
let benchmarks: @Sendable () -> Void = {
13-
Benchmark.defaultConfiguration = .init(
14-
metrics: [.peakMemoryResident, .mallocCountTotal],
15-
thresholds: [
16-
.peakMemoryResident: .init(
17-
/// Tolerate up to 2% of difference compared to the threshold.
18-
relative: [.p90: 2],
19-
/// Tolerate up to one million bytes of difference compared to the threshold.
20-
absolute: [.p90: 1_100_000]
21-
),
22-
.mallocCountTotal: .init(
23-
/// Tolerate up to 1% of difference compared to the threshold.
24-
relative: [.p90: 1],
25-
/// Tolerate up to 2 malloc calls of difference compared to the threshold.
26-
absolute: [.p90: 2]
27-
),
28-
]
29-
)
30-
3113
Benchmark(
3214
"Serializer Allocations",
3315
configuration: .init(
@@ -46,7 +28,7 @@ let benchmarks: @Sendable () -> Void = {
4628
.cpuTotal
4729
]
4830
)
49-
){ benchmark in
31+
) { benchmark in
5032
let parts: [MultipartPart] = .init(repeating: example, count: 1000)
5133

5234
benchmark.startMeasurement()
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"mallocCountTotal": 152740,
3-
"peakMemoryResident": 1100000000
2+
"mallocCountTotal": 152724
43
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"mallocCountTotal": 292343,
3-
"peakMemoryResident": 1200000000
2+
"cpuTotal": 1010000000,
3+
"throughput": 1,
4+
"wallClock": 881000000
45
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"mallocCountTotal": 152687,
3-
"peakMemoryResident": 1000000000
2+
"mallocCountTotal": 152671
43
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"mallocCountTotal": 304694,
3-
"peakMemoryResident": 1100000000
2+
"cpuTotal": 990000000,
3+
"throughput": 1,
4+
"wallClock": 902000000
45
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"mallocCountTotal": 24,
3-
"peakMemoryResident": 400000000
2+
"mallocCountTotal": 8
43
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"mallocCountTotal": 3031,
3-
"peakMemoryResident": 430000000
2+
"cpuTotal": 10000000,
3+
"throughput": 684,
4+
"wallClock": 1540000
45
}

0 commit comments

Comments
 (0)