|
1 | | -<!-- docs: sync from coderbuzz/codex@46af4b9 --> |
| 1 | +<!-- docs: sync from coderbuzz/codex@7af404c --> |
2 | 2 |
|
3 | 3 | # @coderbuzz/sql |
4 | 4 |
|
@@ -140,6 +140,25 @@ db.close(); |
140 | 140 |
|
141 | 141 | --- |
142 | 142 |
|
| 143 | +## Benchmarks |
| 144 | + |
| 145 | +Full results at **[github.com/coderbuzz/benchmarks](https://github.com/coderbuzz/benchmarks)**. |
| 146 | + |
| 147 | +SQL query compilation throughput on Apple M-series, Bun runtime. Higher is better. |
| 148 | + |
| 149 | +| Scenario | @coderbuzz/sql | Kysely | Factor vs Kysely | Drizzle ORM | Factor vs Drizzle | |
| 150 | +|---|---|---|---|---|---| |
| 151 | +| SELECT simple | **1,700,391 ops/s** | 561,869 | **3.0x** | 34,239 | **49.7x** | |
| 152 | +| SELECT JOIN (2 tables) | **2,208,322 ops/s** | 310,690 | **7.1x** | 16,801 | **131.4x** | |
| 153 | +| INSERT single row | **2,954,261 ops/s** | 393,159 | **7.5x** | 55,085 | **53.6x** | |
| 154 | +| INSERT batch 100 rows | **134,187 ops/s** | 17,634 | **7.6x** | 914 | **146.8x** | |
| 155 | +| CTE (WITH clause) | **831,703 ops/s** | 224,893 | **3.7x** | 12,222 | **68.0x** | |
| 156 | +| 10 nested WHERE conditions | **656,309 ops/s** | 117,064 | **5.6x** | 12,692 | **51.7x** | |
| 157 | + |
| 158 | +`@coderbuzz/sql` is 3-7x faster than Kysely and 50-147x faster than Drizzle ORM across every query type. The gap widens with query complexity (batch, JOIN, conditions) due to `@coderbuzz/sql`'s zero-overhead string compilation strategy vs Kysely's AST-based approach and Drizzle's ORM abstraction layer. |
| 159 | + |
| 160 | +--- |
| 161 | + |
143 | 162 | ## Core Concepts |
144 | 163 |
|
145 | 164 | | Concept | What it does | |
|
0 commit comments