mirror of
https://github.com/google/flatbuffers.git
synced 2026-11-10 22:25:10 +00:00
Bigfoot
This commit is contained in:
@@ -97,7 +97,6 @@ let benchmarks = {
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(ByteBuffer(assumingMemoryBound: memory, capacity: Int(oneGB)))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Clearing 1GB", configuration: singleConfiguration) { benchmark in
|
||||
@@ -106,7 +105,6 @@ let benchmarks = {
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(fb.clear())
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Strings 10") { benchmark in
|
||||
@@ -115,7 +113,6 @@ let benchmarks = {
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(fb.create(string: str10))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Strings 100") { benchmark in
|
||||
@@ -124,7 +121,6 @@ let benchmarks = {
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(fb.create(string: str100))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Vector 1 Bytes") { benchmark in
|
||||
@@ -133,7 +129,6 @@ let benchmarks = {
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(fb.createVector(bytes: bytes))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Vector 1 Ints") { benchmark in
|
||||
@@ -142,7 +137,6 @@ let benchmarks = {
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(fb.createVector(ints))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Vector 100 Ints") { benchmark in
|
||||
@@ -151,7 +145,6 @@ let benchmarks = {
|
||||
for i in benchmark.scaledIterations {
|
||||
blackHole(fb.createVector(ints))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Vector 100 Bytes") { benchmark in
|
||||
@@ -160,7 +153,6 @@ let benchmarks = {
|
||||
for i in benchmark.scaledIterations {
|
||||
blackHole(fb.createVector(bytes))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Vector 100 ContiguousBytes") { benchmark in
|
||||
@@ -169,7 +161,6 @@ let benchmarks = {
|
||||
for i in benchmark.scaledIterations {
|
||||
blackHole(fb.createVector(bytes: bytes))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark(
|
||||
@@ -187,7 +178,6 @@ let benchmarks = {
|
||||
fb.add(offset: off, at: 8)
|
||||
blackHole(fb.endTable(at: s))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark(
|
||||
@@ -200,7 +190,6 @@ let benchmarks = {
|
||||
let s = fb.startTable(with: 4)
|
||||
blackHole(fb.endTable(at: s))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Struct") { benchmark in
|
||||
@@ -209,7 +198,6 @@ let benchmarks = {
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(fb.create(struct: array.first!))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Structs") { benchmark in
|
||||
@@ -231,7 +219,6 @@ let benchmarks = {
|
||||
fb.add(offset: vector, at: 4)
|
||||
let root = Offset(offset: fb.endTable(at: start))
|
||||
blackHole(fb.finish(offset: root))
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Vector of Offsets") { benchmark in
|
||||
@@ -252,15 +239,12 @@ let benchmarks = {
|
||||
fb.add(offset: off, at: 2)
|
||||
blackHole(fb.endTable(at: s))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
|
||||
Benchmark("Reading Doubles") { benchmark in
|
||||
let byteBuffer = ByteBuffer(data: data)
|
||||
benchmark.startMeasurement()
|
||||
for _ in benchmark.scaledIterations {
|
||||
blackHole(byteBuffer.read(def: Double.self, position: 0))
|
||||
}
|
||||
benchmark.stopMeasurement()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,14 +39,4 @@ let package = Package(
|
||||
plugins: [
|
||||
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
|
||||
]),
|
||||
.executableTarget(
|
||||
name: "FlexBuffersBenchmarks",
|
||||
dependencies: [
|
||||
.product(name: "FlexBuffers", package: "flatbuffers"),
|
||||
.product(name: "Benchmark", package: "package-benchmark"),
|
||||
],
|
||||
path: "Benchmarks/FlexBuffersBenchmarks",
|
||||
plugins: [
|
||||
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
|
||||
]),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user