Skip to content

Commit 0a8f818

Browse files
Lukasaallevato
authored andcommitted
Add Message.with to the performance suite
1 parent d04ea43 commit 0a8f818

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Performance/generators/swift.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ extension Harness {
9898
populateFields(of: &message)
9999
}
100100
101+
message = measureSubtask("Populate fields with with") {
102+
return populateFieldsWithWith()
103+
}
104+
101105
// Exercise binary serialization.
102106
let data = try measureSubtask("Encode binary") {
103107
return try message.serializedData()
@@ -140,6 +144,20 @@ EOF
140144

141145
cat >> "$gen_harness_path" <<EOF
142146
}
147+
148+
private func populateFieldsWithWith() -> PerfMessage {
149+
return PerfMessage.with { message in
150+
EOF
151+
152+
if [[ "$proto_type" == "homogeneous" ]]; then
153+
generate_swift_homogenerous_populate_fields_body
154+
else
155+
generate_swift_heterogenerous_populate_fields_body
156+
fi
157+
158+
cat >> "$gen_harness_path" <<EOF
159+
}
160+
}
143161
}
144162
EOF
145163
}

Performance/js/harness-visualization.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// on the plot axis.
44
var benchmarks = [
55
'New message', 'Populate fields',
6+
'Populate fields with with',
67
'Encode binary', 'Decode binary',
78
'Encode JSON', 'Decode JSON',
89
'Encode text', 'Decode text',

0 commit comments

Comments
 (0)