|
1 | | -<!-- docs: sync from coderbuzz/codex@7af404c --> |
| 1 | +<!-- docs: sync from coderbuzz/codex@b36584c --> |
2 | 2 |
|
3 | 3 | # @coderbuzz/sql |
4 | 4 |
|
@@ -65,6 +65,23 @@ This is not an ORM. There are no lazy-loaded relations, no magical `save()` meth |
65 | 65 | - **Infer types** — `InferRow<S>`, `InferSelect<S, F>` for subset field selection |
66 | 66 | - **Runtime agnostic** — Bun, Node.js, Deno |
67 | 67 |
|
| 68 | +## Benchmarks |
| 69 | + |
| 70 | +Full results at **[github.com/coderbuzz/benchmarks](https://github.com/coderbuzz/benchmarks)**. |
| 71 | + |
| 72 | +SQL query compilation throughput on Apple M-series, Bun runtime. Higher is better. |
| 73 | + |
| 74 | +| Scenario | @coderbuzz/sql | Kysely | Factor vs Kysely | Drizzle ORM | Factor vs Drizzle | |
| 75 | +|---|---|---|---|---|---| |
| 76 | +| SELECT simple | **1,700,391 ops/s** | 561,869 | **3.0x** | 34,239 | **49.7x** | |
| 77 | +| SELECT JOIN (2 tables) | **2,208,322 ops/s** | 310,690 | **7.1x** | 16,801 | **131.4x** | |
| 78 | +| INSERT single row | **2,954,261 ops/s** | 393,159 | **7.5x** | 55,085 | **53.6x** | |
| 79 | +| INSERT batch 100 rows | **134,187 ops/s** | 17,634 | **7.6x** | 914 | **146.8x** | |
| 80 | +| CTE (WITH clause) | **831,703 ops/s** | 224,893 | **3.7x** | 12,222 | **68.0x** | |
| 81 | +| 10 nested WHERE conditions | **656,309 ops/s** | 117,064 | **5.6x** | 12,692 | **51.7x** | |
| 82 | + |
| 83 | +`@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. |
| 84 | + |
68 | 85 | --- |
69 | 86 |
|
70 | 87 | ## Installation |
@@ -140,25 +157,6 @@ db.close(); |
140 | 157 |
|
141 | 158 | --- |
142 | 159 |
|
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 | | - |
162 | 160 | ## Core Concepts |
163 | 161 |
|
164 | 162 | | Concept | What it does | |
|
0 commit comments