Skip to content

Benchmark transactional mutation/query completion on Workflow and workpool 0.5.0 - #284

Open
ianmacartney wants to merge 8 commits into
mainfrom
ian/workpool-throughput-test
Open

ianmacartney wants to merge 8 commits into
mainfrom
ian/workpool-throughput-test

Conversation

@ianmacartney

@ianmacartney ianmacartney commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

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.

Workload Parallelism Full treatment vs release Adding transactional steps to transactional handlers Scheduled executions vs release
Mutation 25 +15.6% +2.2% −57.5%
Mutation 100 +8.0% +9.9% −58.5%
Query 25 +18.7% −2.0% −12.1%
Query 100 +5.2% −1.8% −10.0%

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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/workflow@284

commit: b0c9a71

@ianmacartney
ianmacartney marked this pull request as ready for review September 12, 2026 03:11

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread experiments/workpool/README.md Resolved
Comment thread experiments/workpool/summarize.mjs Resolved
Comment thread experiments/workpool/RESULTS.md Resolved
Comment thread experiments/workpool/run.mjs Resolved
Comment thread experiments/workpool/run.mjs Resolved
@ianmacartney
ianmacartney force-pushed the ian/workpool-throughput-test branch from 07541fc to 1a8b2e1 Compare September 12, 2026 03:25

ianmacartney commented Sep 15, 2026 •

Copy link
Copy Markdown
Member Author

@ianmacartney
ianmacartney changed the base branch from ian/skip-workflow-success-callbacks to graphite-base/284 September 15, 2026 05:49
ianmacartney added a commit that referenced this pull request Sep 15, 2026
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).
@ianmacartney
ianmacartney force-pushed the ian/workpool-throughput-test branch from 1a8b2e1 to e99ddb5 Compare September 15, 2026 05:50
@cursor
cursor Bot changed the base branch from graphite-base/284 to main September 15, 2026 05:50
@ianmacartney
ianmacartney force-pushed the ian/workpool-throughput-test branch 2 times, most recently from ad27f14 to e99ddb5 Compare September 15, 2026 05:50

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread experiments/workpool/README.md Resolved
Comment thread experiments/workpool/logs.test.mjs Resolved
Comment thread experiments/workpool/README.md Resolved
@ianmacartney
ianmacartney force-pushed the ian/workpool-throughput-test branch from 3a2a8c5 to e68d860 Compare November 24, 2026 07:11
@ianmacartney ianmacartney changed the title Benchmark callback exclusion and transactional workpool completion Benchmark transactional mutation/query completion on Workflow and workpool 0.5.0 Nov 24, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 29 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread experiments/workpool/prepare.mjs Resolved
Comment thread experiments/workpool/package.json Resolved
Comment thread experiments/workpool/logs.mjs Resolved
Comment thread experiments/workpool/summarize.mjs Resolved
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