Repository navigation
Commit 129cf13
function_storage: persistent per-thread connections + WAL-friendly pragmas
Open-then-close on every call cost ~1ms of fsync + connect on the aggregate
hot path. Switch to a thread-local connection lazily initialized with
synchronous=NORMAL, busy_timeout, temp_store=MEMORY, and a 64MiB cache.
WAL still coordinates writes across worker processes; per-thread
connections inside a process avoid check_same_thread without serializing
through a Python lock.
Microbench (fresh DB, 2k iters):
- aggregate_state_put x1: 552 -> 15 µs/op (36x)
- aggregate_state_get x50: 335 -> 34 µs/op (10x)
- worker_put (1KB state): 620 -> 38 µs/op (16x)
- queue_push + queue_pop pair: 1053 -> 34 µs/op (31x)
Also pass -j 8 to the unittest binary in scripts/run_all_tests.sh so the
DuckDB integration suite parallelizes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c1cd267 commit 129cf13
2 files changed
Lines changed: 261 additions & 280 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
0 commit comments