Merge 'perf/memory: benchmark FTS queries and concurrent transactions' from Pedro Muniz

## Purpose
Add shared FTS query workloads for dhat allocation-stack investigations
and Divan/CodSpeed memory tracking without changing the existing
Criterion profiles.
- Measure query-only cases separately from complete BEGIN
CONCURRENT/query/COMMIT lifecycles, including repeated overlapping
transactions on multiple connections.
- Emit explicit workload-phase events and query-phase heap reports.
- Add a deterministic high-vocabulary corpus, configurable page cache,
and actual stored segment-byte verification before measurement.
- Run FTS workload/CLI tests in CI, with separate fts-queries and fts-
large-index CodSpeed shards. The large case requires at least 256 MiB of
segment data and uses a 200-page cache.
## Measurement limits
Warm dhat runs exclude allocations made during setup and warm-up. Local
Divan does not count Tokio worker-thread allocations; use dhat for
complete concurrent totals. Exceeding the 192 MiB retained-segment
budget does not prove eviction or bounded live memory, and read-only
transactions do not exercise the four-searcher limit across changing
snapshots.
## Validation
- Focused FTS unit tests passed locally (4 tests before the final
additional segment-boundary test).
- Earlier small-corpus harness validation passed before the large-index
extension.
- cargo fmt and git diff --check completed.
- Final local build/test runs were cancelled at pedrocarlo’s request to
run validation in PR CI instead. The optimized large-index measurement
has not completed locally; its minimum-byte assertion and CI results
remain to be verified.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #8866
This commit is contained in:
Pedro Muniz
2026-09-09 11:46:53 -03:00
committed by GitHub
12 changed files with 1653 additions and 3 deletions

3
Cargo.lock generated
View File

@@ -3740,10 +3740,12 @@ dependencies = [
"serde",
"serde_json",
"stacker",
"tempfile",
"tokio",
"tracing",
"tracing-subscriber",
"turso",
"turso_core",
"turso_parser",
]
@@ -3752,6 +3754,7 @@ name = "memory-benchmark-codspeed"
version = "0.1.0"
dependencies = [
"codspeed-criterion-compat",
"codspeed-divan-compat",
"criterion",
"memory-benchmark",
"tokio",