What PROFILE Hides: True 2.46× Parallel Speedup, 16× Query Rewrites (+122 Paths), and 0.47% Graph-CoT DB Stalls
Synthesizing four unpublished storage and runtime studies: PROFILE instrumentation distortion on Aura, constraint/DP query rewrites exposing trail-vs-walk bugs, PyOxigraph vs Neo4j concurrency saturation, and Graph-CoT's 0.47% DB stall share.
Headline result: Non-PROFILE server W4: 2.46× (vs 5.38× PROFILE server) · DP rewrite 16.2× (+122 walks) · Graph-CoT DB stall 0.47%
On this page (7 sections)
- 1. Motivation & System Bottleneck
- 2. Hypothesis, Falsification & Experimental Architecture
- 3. Environment & Reproducibility Protocol
- 4. Visual Evidence & Quantitative Results
- 5. Mechanism Breakdown: Why Constraints & Semantics Trump Flags
- 6. Key Findings & Transferable Insights
- 7. Scope Limits & Next Experiment
Pre-registered Hypothesis, Falsification Criteria & Environment Manifest
- Hypothesis
- Removing PROFILE instrumentation reveals smaller true Parallel runtime gains than PROFILE-inflated benchmarks suggest, while schema constraints, hop pre-aggregation, and embedded RDF storage outperform runtime switching cleanly—until walk-vs-trail self-loop semantics diverge.
- Falsification Criteria
- If removing PROFILE fails to narrow the W4 Parallel speedup gap, query rewrites fail to alter hit counts/hashes cleanly, or Graph-CoT DB stalls exceed 5% of agent turn wall time, query/runtime attribution shifts back toward driver tuning.
- Host / Compute
- Neo4j AuraDB Pro managed instance (4 workers, 544 MiB page cache) & local workstation (i7-11700)
- Runtime
- Neo4j 5.27-aura Enterprise (Cypher 5/25) + PyOxigraph + Graph-CoT Read-Path v2
- Workload / Dataset
- Aura lab (5K nodes, 40K edges, 8 self-loops); MFG FMEA (1,362 quads / L1580); Healthcare Graph-CoT (n=270 Qs)
- Sample Size / Repeats
- 180 non-PROFILE randomized timing runs + 10-case constraint/DP study + n=270 Graph-CoT & n=32 LLM loadtest
1. Motivation & System Bottleneck
Our earlier Aura runtime study used PROFILE queries and reported a 4.11× speedup on heavy global 3-hop analytics (W4). Yet three practical questions remained unanswered in follow-up scripts left locally across ~/lab/aura-runtime/study/ and ~/lab/seocho-rust/:
- How much of Slotted’s
2.3 slatency came fromPROFILErow-counting hooks rather than actual query execution? - Can schema constraints and query rewrites beat runtime hints altogether—and are they semantically identical?
- When a full Graph-CoT or tool-calling agent queries an external graph DB (
Neo4j) versus an embedded RDF store (PyOxigraph), does database execution even matter compared to LLM turn time?
2. Hypothesis, Falsification & Experimental Architecture
Across aura-runtime/study/ (timing.csv, optimize.json, monitor.json) and seocho-rust (mfg_ontology_bench, graphcot_readpath), we isolated query instrumentation, schema constraints, and storage-vs-LLM attribution:
3. Environment & Reproducibility Protocol
- Aura Enterprise Study (
aura-runtime/study/): AuraDB Pro managed instance (Neo4j5.27-auraEnterprise,4workers,544 MiBpage cache),5,000nodes /40,000edges +5,000-edge hub (8self-loops). Rantiming_bench.py(10randomized rounds × 6 workloads × 3 runtimes =180non-PROFILE runs),optimize_lab.py(7property/type/key constraints +5constraint-sensitive plans + W4 DP rewrite), andmonitor_lab.py(50 msSHOW TRANSACTIONSpoll + lock termination). - Manufacturing FMEA (
seocho-rust/experiments/mfg_ontology_bench/):1,362quads in PyOxigraph vs Neo4j across 5 FMEA scenarios (6 read queries + 2 writes), closed-loop concurrencyc=1..64onL1580, plus32-questiongpt-oss-120btool-agent loadtest. - Graph-CoT Read-Path (
seocho-rust/experiments/graphcot_readpath/): Healthcare KG (n=270questions,2,046tool calls incl.1,529DB calls). (Note: Neo4j Enterprise scale extensions inauto-ontology-benchremain excluded per Neo4j AUP and cataloged openly under Beadsyw-pow.6.)
4. Visual Evidence & Quantitative Results
Full Size ↗
| Experiment / Optimization | Before | After / Variant | Key Delta |
|---|---|---|---|
Aura W4 Non-PROFILE (n=10 server med) | Slotted 1,226.5 ms [1,158–1,378] | Pipelined 901.0 ms / Parallel 498.0 ms | 2.46× server (vs 5.38× PROFILE server / 4.11× wall) |
W4 DP Pre-Aggregation (n=5 server med) | Slotted 1,244 ms (6.14M hits) | Slotted DP 77 ms (273K hits) | 16.2× faster, +122 walk paths |
Constraint O1 (n.score IS NOT NULL) | NodeIndexScan (5,001 hits, 4 ms) | NodeCountFromCountStore (1 hit, 1 ms) | O(N) → O(1) metadata read |
Constraint O3 (()-[r]->() strength IS NOT NULL) | RelTypeScan > Filter (80,001 hits, 11 ms) | RelationshipCountFromCountStore (1 hit, 1 ms) | 80,001× DB hit drop |
Aura SHOW TRANSACTIONS Memory (monitor.json) | Slotted heap 58 MB (2.12M pageHits) | Parallel 4.5 MB (0 hits) / Pipe 2 MB | 0 hits is telemetry blindspot |
Full Size ↗
| Storage / Agent Benchmark | Configuration | Throughput / Accuracy | Latency & Bottleneck Split |
|---|---|---|---|
MFG Neo4j Closed-Loop Mix M (L1580) | c=1 → c=16 → c=64 | 65.2 → 265.7 → 259.4 req/s | 7.98 CPU cores saturate by c=16; p99 75.1 → 1,604.7 ms |
MFG Neo4j Write Mix W (L1580) | c=1 → c=32 | 1,477.3 → 12,114.1 req/s | dup obs write skew at c=32 (1/3) & c=64 (1/2) |
MFG LLM Loadtest (n=32, gpt-oss-120b) | LPG c=16 vs RDF c=4 | Both 32/32 full P/R (100.36 vs 46.34 Q/min) | LPG 93.6% LLM vs 207.3 ms tool p50; RDF 53.6% LLM |
Graph-CoT Read-Path (n=270) | Healthcare (gpt-oss-120b) | 50.74% finished, 0.212 F1 (7.58 calls/Q) | Total stall_share_wall 0.47% (p50 2.79 vs 1,151.7 ms) |
5. Mechanism Breakdown: Why Constraints & Semantics Trump Flags
- Why
PROFILEfooled our first benchmark: Enabling per-operator row/hit telemetry adds instrumentation work disproportionately insideSlotted’s row-at-a-time volcano loop (2,186ms vs1,226.5ms server time, inflating apparent server speedup to5.38×over406ms Parallel and client-wall to4.11×vs true non-PROFILE2.46×). Conversely,Parallelworker threads fail to update transaction-levelpageHitsinSHOW TRANSACTIONS, printing0hits during active 3-hop execution—so production alerts onpageHitswould falsely assume zero cache reads. - Why hop-by-hop pre-aggregation breaks exact equality (
1,791,878vs1,792,000):
MATCH (c:AuraRuntimeLabNode)-[:AURA_LAB_LINK]->(d:AuraRuntimeLabNode) WHERE d.score >= 30
WITH c, count(*) AS n, sum(d.score) AS s
MATCH (b:AuraRuntimeLabNode)-[:AURA_LAB_LINK]->(c) WITH b, sum(n) AS n, sum(s) AS s
MATCH (a:AuraRuntimeLabNode)-[:AURA_LAB_LINK]->(b) WITH a.segment AS segment, sum(n) AS path_count, sum(s) AS ss
RETURN segment, path_count, toFloat(ss)/path_count AS mean_score
By breaking a 3-hop MATCH (a)-[]->(b)-[]->(c)-[]->(d) pattern into three WITH clauses, each step forgets previously traversed relationship IDs. That reduces Slotted execution from 1,244 ms to 77 ms (22.5× fewer DB hits), but turns Cypher’s default trail semantics (edge uniqueness within one pattern) into walk semantics (edge revisits allowed across 8 self-loops). Running the original single pattern under CYPHER 25 MATCH REPEATABLE ELEMENTS reproduced 1,792,000 identically.
- Why DB speed barely moves multi-turn Graph-CoT: Across
n=270healthcare questions (2,046tool calls /2,182LLM turns), single-turn DB lookups take2.79ms p50 (p99 = 27.11ms) versus1,151.7ms p50 LLM turns (412×slower), and total accumulated DB wait across episodes (stall_share_wall) is just0.47%([0.44%–0.50%]; server-only share2.13%). Removing 100% of DB latency would trim under0.5%of end-to-end wall time unless concurrency pushes Neo4j above its ~8-core CPU saturation knee (265.7req/s onL1580).
6. Key Findings & Transferable Insights
Distilled via multi-agent deliberation (Codex + Claude):
- Cross-session managed DB drift (
~23%) requires interleaved timing rounds: ParallelW4server execution shifted from406 ms(STUDY.mdPROFILE snapshot) to498.0 msin our later non-PROFILE run (~23%opposite-direction drift vs Slotted2,186 → 1,226.5 ms). Rule: UsePROFILEonly for query-plan inspection, then benchmark uninstrumented runtimes interleaved in the same session. - Pair Amdahl’s DB-share ceiling (
0.47%) with agent task completion (50.74%,0.212F1): Optimizing sub-3 ms DB queries saves under0.5%wall time per turn in Graph-CoT while half the agent runs fail or stall in reasoning (1,151.7 ms/turn)—and treatParallel pageHits = 0inSHOW TRANSACTIONSas an instrumentation blindspot rather than cache misses. - Never deploy pre-aggregation rewrites on cyclic/self-loop graphs without walk-vs-trail parity verification:
16.2×latency cuts that convert Cypher trail semantics (1,791,878) into walk semantics (1,792,000) silently corrupt exact distinct-path counts.
7. Scope Limits & Next Experiment
- Graph scale & Enterprise boundaries: Aura lab (
5Knodes) fits entirely inside the544 MiBpage cache, whereas Neo4j Enterprise multi-hundred-thousand-node scale and tuning sweeps remain withheld per Neo4j AUP restrictions (yw-pow.6). - Write skew & unexecuted Graph-CoT arms: Concurrent writes in
L1580produced duplicate observations underc >= 32without unique merge locking, and the 8-graph local latency ladder (sr-tlc.3) plus Vastgpt-oss-120bco-location (sr-tlc.4) remain open inseocho-rust/.beads.