You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
benchmark: add Postgres and MySQL comparisons vs Vapor drivers
- Add postgres-nio (Vapor) and mysql-nio (Vapor) as benchmark dependencies
- New benchmark sections: CosmoPostgres vs postgres-nio, CosmoMySQL vs mysql-nio
- Fix format string segfault: use %@ / NSString instead of %s for Swift strings
- Fix mysql-nio EventLoopFuture API: call .get() to bridge to async/await
- Fix PostgresNIO.Configuration: use flat init(host:port:username:password:database:tls:)
- Update README with full results table for all three databases
- New env vars: PG_HOST/PORT/DB/USER/PASS/QUERY, MYSQL_HOST/PORT/DB/USER/PASS/QUERY
Results (20 iterations, localhost via frpc):
MSSQL warm query: CosmoSQL 0.91ms vs FreeTDS 1.56ms (42% faster)
Postgres warm query: CosmoSQL 0.39ms vs postgres-nio 0.35ms (~tie)
MySQL warm query: CosmoSQL 0.37ms vs mysql-nio 0.48ms (22% faster)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| Warm single-row query | 0.73 ms |**0.27 ms**|~varies |
103
+
| Warm `decode<T>()`| 0.36 ms | N/A | 🔵 only |
104
+
| Warm `toJson()`| 0.44 ms | N/A | 🔵 only |
68
105
69
106
## Notes
70
107
108
+
- Cold connect differences are dominated by TLS handshake time — use connection pooling (`CosmoMSSQL`, `CosmoPostgres`, `CosmoMySQL` all include built-in pools)
109
+
- Warm query benchmarks reflect steady-state throughput on a persistent connection
71
110
- FreeTDS benchmarks are skipped if FreeTDS is not installed (graceful degradation)
72
-
-Results include avg / min / max ms per iteration and a winner comparison table
73
-
- Use `BENCH_ITER=50` or higher for more stable results
111
+
-postgres-nio and mysql-nio warm comparisons exclude `decode<T>()` / `toJson()` as those are CosmoSQL-only features
112
+
- Use `BENCH_ITER=50` or higher for more stable averages
0 commit comments