Skip to content

perf(pdm): batch record queries into larger pages - #137

Closed
prdai wants to merge 1 commit into
feat/algorithm-seed-tablefrom
perf/pdm-page-batching
Closed

prdai wants to merge 1 commit into
feat/algorithm-seed-tablefrom
perf/pdm-page-batching

Conversation

@prdai

@prdai prdai commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

what changed

  • PDM /records now fills each response from several DynamoDB queries, up to 2000 items or about 2.5 MB, instead of a single 500-item query.
  • Applied to both the rads and secure handlers. Cursor semantics are unchanged, so sce-unit and the rads host tools need no changes.
  • Read-capacity cost events aggregate across the internal queries.

why

Phase data from the deployed 150k runs: data retrieval takes 34-38 s on rads and 37-42 s on secure-rads. That is 300 sequential pages at roughly 110-125 ms each. DynamoDB latency is a small part of each page; HTTP round trips dominate. Fewer, larger pages cut that without adding a cache or new infrastructure.

verification

  • bun run typecheck and bun run lint pass in both pdm-service trees.
  • Not deployed or measured yet. Expected data retrieval at 150k to drop from ~34-42 s to single digits; needs a live re-run.

notes

  • Stacked on feat(pdm): use one DynamoDB table per algorithm #136. Base branch is feat/algorithm-seed-table.
  • 2000 items alone is unsafe: finance averages 5.9 KB per record, so a 2000-item page would be ~11.8 MB. The page also stops at ~2.5 MB, and DynamoDB's 1 MB query cap bounds the overshoot.
  • This is not a data cache. It reduces PDM round trips; a cache such as DAX would only shave DynamoDB time inside each page.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Co-authored-by: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant