Add Hummingbird: Swift HTTP framework on SwiftNIO (first Swift entry!)#23
Add Hummingbird: Swift HTTP framework on SwiftNIO (first Swift entry!)#23MDA2AV merged 4 commits intoMDA2AV:mainfrom
Conversation
swift-async-algorithms (transitive dep via Hummingbird 2.x) uses #isolation macro which requires Swift 6.0+. The build fails with 'non-built-in macro cannot be used as default argument' on 5.10.
|
Build fix: Bumped to |
|
The SQLite3 overlay module ( Added a Should compile on Linux now. |
Benchmark ResultsFramework: Full log |
You should be able to just install sqlite3-dev in the Dockerfile for SQLite headers. You shouldn't need to mess with additional shims. Also you are best using latest Swift 6.2. I haven't looked at the code as I am away for the next week or so but will have a look when I get back. |
Per adam-fowler's review: use latest Swift 6.2 image. Also bumped swift-tools-version from 5.9 to 6.0.
|
Thanks for the review @adam-fowler! 🙏 Bumped to Swift 6.2 — good call, no reason to stay on 6.0. On the CSQLite shim: I actually do have The source code already handles both with: #if canImport(CSQLite)
import CSQLite
#elseif canImport(SQLite3)
import SQLite3
#endifSo it works on both macOS (via the SDK overlay) and Linux (via the systemLibrary). If there's a cleaner way in Swift 6.2 I'm not aware of, happy to update! Enjoy the week off — no rush at all on the review. |
|
Swift 6.2 has a bunch of runtime performance fixes that affect Hummingbird 2 too. |
|
Nice — that's great to hear! Hummingbird was already putting up solid numbers on 6.0, so the 6.2 runtime fixes should give it an extra edge. Looking forward to seeing the delta once benchmarks run on the updated Swift. |
Hummingbird — Swift HTTP Framework
Adds Hummingbird (~1,700 ⭐) to HttpArena — this is the first Swift framework in the benchmark suite!
What is Hummingbird?
Hummingbird is a lightweight, flexible HTTP server framework built on SwiftNIO. It's designed with minimal dependencies and uses Swift's structured concurrency (async/await) throughout. Part of the Swift Server Work Group incubation ecosystem.
Why it's interesting for benchmarks
Implementation details
/pipeline,/baseline11,/baseline2,/json,/compression,/db,/upload,/static/{filename}/jsonand/compressionendpoints-Oand cross-module optimizationTests enabled
baseline, noisy, pipelined, limited-conn, json, upload, compression, mixed
cc @adam-fowler @Joannis — thought it'd be cool to see how Hummingbird stacks up in HttpArena! Would love to hear if there are any Swift-specific optimizations we should try.