Skip to content

Commit 129cf13

Browse files
rustyconoverclaude
andcommitted
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

File tree

‎scripts/run_all_tests.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ run_pytest_job() {
182182
run_integration_job() {
183183
cd /Users/rusty/Development/vgi || exit 99
184184
VGI_TEST_WORKER="uv run --project /Users/rusty/Development/vgi-python vgi-fixture-worker" \
185-
timeout 600 ./build/release/test/unittest "test/sql/integration/*" >"$INT_LOG" 2>&1
185+
timeout 600 ./build/release/test/unittest -j 8 "test/sql/integration/*" >"$INT_LOG" 2>&1
186186
local rc=$?
187187
summarize_integration "$INT_LOG" "$INT_SUMMARY" "$INT_FAILURES"
188188
echo "exit=$rc" >>"$INT_SUMMARY"

0 commit comments

Comments
 (0)