Commit 4841177
committed
perf(database): avoid rewriting single SQL spaces
Only replace whitespace when a non-space whitespace character or repeated
spaces are present. Keep trimming unconditional and retain the existing
replacement semantics for formatted queries.
Bun 1.4.1 focused repeat medians: prepared SQL 344 ns to 171 ns, long single-
spaced SQL 6.44 us to 5.18 us, formatted SQL 369 ns to 374 ns, Unicode whitespace
379 ns to 377 ns. Developer laptop results; full query/log timings were mixed,
so this does not claim an HTTP throughput improvement.
Verified 340927 generated cases, 1823 tests, framework types, and lint.
Final HTTP validation returned 139250 successful requests with exactly 139250
persisted logs. Add mixed/Unicode whitespace cases and a multiline persisted
query assertion.1 parent e679e1b commit 4841177
3 files changed
Lines changed: 13 additions & 3 deletions
File tree
- storage/framework/core/database
- src
- tests
- fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
| |||
0 commit comments