diff --git a/Benchmarks/.gitignore b/Benchmarks/.gitignore new file mode 100644 index 0000000..0023a53 --- /dev/null +++ b/Benchmarks/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +/.build +/Packages +xcuserdata/ +DerivedData/ +.swiftpm/configuration/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Benchmarks/Benchmarks/HTTPFieldsBenchmarks/Benchmarks.swift b/Benchmarks/Benchmarks/HTTPFieldsBenchmarks/Benchmarks.swift new file mode 100644 index 0000000..a8494c1 --- /dev/null +++ b/Benchmarks/Benchmarks/HTTPFieldsBenchmarks/Benchmarks.swift @@ -0,0 +1,16 @@ +import HTTPTypes +import Benchmark + +let benchmarks = { + Benchmark( + "Initialize HTTPFields from Dictionary Literal" + ) { benchmark in + let fiels: HTTPFields = [ + .contentType: "application/json", + .contentLength: "42", + .connection: "keep-alive", + .accept: "application/json", + .acceptEncoding: "gzip, deflate, br", + ] + } +} \ No newline at end of file diff --git a/Benchmarks/Package.swift b/Benchmarks/Package.swift new file mode 100644 index 0000000..18d6ebd --- /dev/null +++ b/Benchmarks/Package.swift @@ -0,0 +1,27 @@ +// swift-tools-version: 5.7.1 + +import PackageDescription + +let package = Package( + name: "Benchmarks", + platforms: [ + .macOS(.v13) + ], + dependencies: [ + .package(path: "../"), + .package(url: "https://github.com/ordo-one/package-benchmark.git", from: "1.22.1"), + ], + targets: [ + .executableTarget( + name: "Benchmarks", + dependencies: [ + .product(name: "Benchmark", package: "package-benchmark"), + .product(name: "HTTPTypes", package: "swift-http-types"), + ], + path: "Benchmarks/HTTPFieldsBenchmarks", + plugins: [ + .plugin(name: "BenchmarkPlugin", package: "package-benchmark") + ] + ), + ] +)