Swift update performance benchmark infrastructure (#7255)

* Keep the underlying storage capacity when clearing the FlatBufferBuilder. Gives a significant performance boost for serialisation of many small messages.

* Use Googles Swift benchmark library for more consistent results and dynamic number of iterations, simplification of tests as result.

Co-authored-by: Joakim Hassila <hassila@users.noreply.github.com>
This commit is contained in:
Joakim Hassila
2022-04-19 10:52:10 +02:00
committed by GitHub
parent 70002dc5ca
commit 23c8ab34c1
2 changed files with 15 additions and 67 deletions

View File

@@ -24,9 +24,11 @@ let package = Package(
],
dependencies: [
.package(path: "../../swift"),
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
],
targets: [
.target(
name: "FlatBuffers.Benchmarks.swift",
dependencies: ["FlatBuffers"]),
dependencies: ["FlatBuffers",
.product(name: "Benchmark", package: "swift-benchmark")]),
])