mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 14:00:02 +00:00
[Swift] Implements FlatbuffersVector which confirms to RandomAccessCollection (#8752)
* Implements FlatbuffersVector in swift Implements FlatbuffersVector which confirms to RandomAccessCollection, this would give us semi-native sugary syntax to all the arrays in swift port. This work will also be the foundation of using arrays in swift * Fix failing tests for Swift
This commit is contained in:
@@ -88,8 +88,8 @@ let benchmarks = {
|
||||
|
||||
Benchmark(
|
||||
"Allocating ByteBuffer 1GB",
|
||||
configuration: singleConfiguration
|
||||
) { benchmark in
|
||||
configuration: singleConfiguration)
|
||||
{ benchmark in
|
||||
let memory = UnsafeMutableRawPointer.allocate(
|
||||
byteCount: 1_024_000_000,
|
||||
alignment: 1)
|
||||
@@ -165,8 +165,8 @@ let benchmarks = {
|
||||
|
||||
Benchmark(
|
||||
"FlatBufferBuilder Add",
|
||||
configuration: kiloConfiguration
|
||||
) { benchmark in
|
||||
configuration: kiloConfiguration)
|
||||
{ benchmark in
|
||||
var fb = FlatBufferBuilder(initialSize: 1024 * 1024 * 32)
|
||||
benchmark.startMeasurement()
|
||||
for _ in benchmark.scaledIterations {
|
||||
@@ -182,8 +182,8 @@ let benchmarks = {
|
||||
|
||||
Benchmark(
|
||||
"FlatBufferBuilder Start table",
|
||||
configuration: kiloConfiguration
|
||||
) { benchmark in
|
||||
configuration: kiloConfiguration)
|
||||
{ benchmark in
|
||||
var fb = FlatBufferBuilder(initialSize: 1024 * 1024 * 32)
|
||||
benchmark.startMeasurement()
|
||||
for _ in benchmark.scaledIterations {
|
||||
|
||||
@@ -20,7 +20,7 @@ import PackageDescription
|
||||
let package = Package(
|
||||
name: "benchmarks",
|
||||
platforms: [
|
||||
.macOS(.v13)
|
||||
.macOS(.v13),
|
||||
],
|
||||
dependencies: [
|
||||
.package(path: "../.."),
|
||||
@@ -37,6 +37,6 @@ let package = Package(
|
||||
],
|
||||
path: "Benchmarks/FlatbuffersBenchmarks",
|
||||
plugins: [
|
||||
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
|
||||
])
|
||||
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
|
||||
]),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user