Commit de326fe
authored
perf(workflow): batch the workflow-list first page into one journal RPC (kill N+1) (#325)
The DB-page workflow-list path did query_ids + a per-id `load` loop — one journal
RPC per run (N+1). Bounded to 200 (via the graphql default limit) that's still
201 serialized RPCs on the journal plugin's stdio host, which queued behind other
traffic and made /workflows intermittently multi-second.
Add journal_client::list_page + WorkflowStateManager::list_page: fetch the `limit`
newest runs in ONE bounded journal/list RPC (the plugin already supports the
limit). The query() first-page path (offset 0) now does one list RPC + a cheap
ids-only count for `total`, instead of the load loop. Offset>0 keeps the id-walk
(the list RPC has no offset). Additive; list_all/query_ids unchanged.
cargo check/fmt/clippy clean; orchestrator-core tests 160 passed.1 parent 3a4dced commit de326fe
3 files changed
Lines changed: 51 additions & 0 deletions
File tree
- crates/orchestrator-core/src
- services
- workflow
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
372 | 385 | | |
373 | 386 | | |
374 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
472 | 493 | | |
473 | 494 | | |
474 | 495 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
365 | 382 | | |
366 | 383 | | |
367 | 384 | | |
| |||
0 commit comments