Repository navigation
Benchmark transactional mutation/query completion on Workflow and workpool 0.5.0 - #284
ianmacartney wants to merge 8 commits into
Conversation
commit: |
There was a problem hiding this comment.
All reported issues were addressed across 20 files
Not reviewed (too large): experiments/workpool/results.json (~4,362 lines), experiments/workpool/historical/results.json (~3,108 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
07541fc to
1a8b2e1
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Workflow handler completion already returns immediately on success. Update the workpool development dependency to 0.4.12 and set `onCompleteExcludeKinds: ["success"]` when scheduling async start, restart, and handler resume. Keep the peer dependency at `^0.4.4`: older clients ignore the option and preserve existing behavior, while 0.4.12 skips these unnecessary callbacks. Failure, cancellation, and ordinary step result handling are preserved. Compatibility verification used the published workpool 0.4.4 JavaScript client and its component in `convex-test`. All six single/batch enqueue checks passed: the client omits the new option from serialized arguments, the component accepts the enqueue, and success/failure/cancellation callbacks still run. Only the development dependency and its lockfile resolution are upgraded. Use workpool's test registration helper to include its nested batch worker, and accommodate the newly `unknown` success result type in the existing size check. Validation: build and both TypeScript checks pass; 129 tests pass, including six new cases exercising callback exclusion and failure propagation for all three scheduling paths. Lint passes with three existing warnings. The change was also exercised in the isolated benchmark deployment in #284. Stacked experiment #284 compares callback inclusion vs. exclusion on released 0.4.12, then evaluates transactional completion. Exclusion removes 600 callbacks per 100 five-step workflows (~18% fewer scheduled executions). Across three measured trials per configuration, median committed throughput changed by −20.7% at parallelism 25 and +9.6% at 100 (+6.6% including admission). Timing ranges are wide; the measured benefit is consistent callback elimination, not a universal throughput gain. See [the full results](https://github.com/get-convex/workflow/blob/ian/workpool-throughput-test/experiments/workpool/RESULTS.md).
92ed0be to
0fec4c2
Compare
1a8b2e1 to
e99ddb5
Compare
ad27f14 to
e99ddb5
Compare
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
3a2a8c5 to
e68d860
Compare
There was a problem hiding this comment.
All reported issues were addressed across 29 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic

Rebases the experiment onto current main and reruns it with Workflow 0.5.0 and released workpool 0.5.0. Workpool PRs #238/#239 are also rebased onto workpool main, with their source patch and a pinned local package included for reproduction. All controls preserve current Workflow's ignored-success exclusion; runtime and peer dependencies remain unchanged.
64 trials cover mutation and query workflows at parallelism 25 and 100: one 10-workflow warm-up and three measured rounds of 100 workflows × five steps per configuration. Four modes compare the release, PR package with transactions off, transactional handlers, and transactional handlers plus steps. Results and writes are verified, queues drain between trials, and execution logs are audited.
Mutation transactionality provides modest throughput gains and substantially less scheduling overhead. Query-specific transactionality adds no demonstrated throughput benefit over transactional handlers alone and increases scheduled executions by 67–73%, since it replaces action batches with individual mutation wrappers. The query release comparisons include gains from mutation handlers and should not be attributed to the query option.
Three rounds on a shared development backend are descriptive, not guaranteed gains. The PR-off control differs from the release in some configurations, and one handler-only query trial was much slower. Full results and ranges retain both controls, admission-inclusive rates, and all samples. September measurements are archived separately.
Validation: all 48 measured trials and 16 warm-ups passed correctness and log audits. No measured retries or runtime errors; 36 warm-up retry attempts are retained. Three direct-pool failure/cancellation/rollback preflights passed; workflow-step failure recovery is outside this throughput experiment. Clean npm ci, library build, root/example/benchmark typechecks, 187 Workflow/harness tests, and 321 rebased workpool tests pass. Lint has three existing warnings; formatting passes. The benchmark uses isolated dev deployment effervescent-horse-682.