QuickJS engine: inline step execution + WASM module caching - #3049
Draft
TooTallNate wants to merge 1 commit into
Draft
QuickJS engine: inline step execution + WASM module caching#3049TooTallNate wants to merge 1 commit into
TooTallNate wants to merge 1 commit into
Conversation
… WASM module caching
🦋 Changeset detectedLatest commit: af8a0d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Contributor
🧪 E2E Test Results✅ All tests passed Summary
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ 📋 Other
✅ vercel-multi-region
❌ Some E2E test jobs failed:
Check the workflow run for details. |
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 2 of the QuickJS VM roadmap: performance work for the
WORKFLOW_VM=quickjsengine.Live-VM inline step execution. The QuickJS entrypoint now keeps the suspended VM alive (
startQuickJSWorkflowreturns a session withcontinueWithEvents) and drives an inline continuation loop per invocation:hook.getConflict(),setAttributes(), racing sleeps — advance before any step body blocks the invocation.WORKFLOW_MAX_INLINE_STEPSsteps created by this invocation are executed inline, in parallel (executeStep+ in-process single-flight), with theReplayBudgetpaused during step bodies. Terminal events are fed back into the same live VM — no fresh-VM re-replay and no queue round-trip per step.wait_completedat the right log position while this one is busy. This is what keepsPromise.race([step, sleep])semantics.deliveryAttempt > 1triggers backstop step messages. (Ownership-lease stamping like the node engine'sownerMessageIdmodel is a noted follow-up; the interim model can rarely double-run a step body cross-instance, within the documented at-least-once step contract.)attr_set/getConflictimmediate-requeue round-trips — those now resolve in-process.Process-wide WASM module caching.
WebAssembly.compileof the QuickJS runtime (~600 KB) and its native extensions now happens once per process (shared promise), instead of on every invocation.The VM interrupt budget is now per-execution-burst (reset on each
continueWithEvents) instead of per-VM-lifetime, since sessions legitimately live for minutes across inline step bodies.Results (local dev, world-local, nextjs-turbopack)
hookWorkflowacross ~25 runs — under investigation, also being watched on the base branch)fibonacciWorkflow−10%,writableForwardedFromStepWorkflow−36%); the intended payoff is cloud worlds where each queue hop is a network round-trip. Suite wall-clock is dominated by fixed sleeps and unchanged (±2%).Notes
dispatchPendingOps) no longer queues steps at all — queueing is a caller decision (queueStepMessage), keeping drain semantics identical to the node engine'sdrainPendingQueueItems.