Skip to content

chore(eve): performance - measure turns and remove root overhead - #2814

Merged
AndrewBarba merged 14 commits into
mainfrom
barba/turn-performance-tracking
Sep 1, 2026
Merged

chore(eve): performance - measure turns and remove root overhead#2814
AndrewBarba merged 14 commits into
mainfrom
barba/turn-performance-tracking

Conversation

@AndrewBarba

@AndrewBarba AndrewBarba commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Related to #876. eve's deterministic Vercel Workflow stress fixture exposed multi-second turn latency but did not retain structured measurements. This PR adds versioned sequential and concurrent samples, an informational report in the GitHub job summary, and 30-day JSON/Markdown artifacts so every relevant PR leaves inspectable evidence.

It also removes caller-resolution, caller-bind, and caller-notification steps when serialized lineage proves the session is a root session. Delegated, task, callback, failure, and cancellation paths retain the existing caller protocol. Best-effort Workflow attributes start alongside result settlement, but remain joined before the durable step exits so cumulative writes cannot reorder or outlive the step.

The research plan records the critical-path attribution, low-risk waitUntil audit, independently pushed experiments, hosted result ledger, rejected alternatives, required Workflow primitives, and a paired base/head benchmark design.

Hosted result

The exact benchmark-base and current candidate stress jobs both completed successfully and uploaded raw reports:

Metric Control 33468124247 Candidate 33469404605 Delta
Sequential mean 3.042 s 2.009 s -34.0%
Sequential p50 3.036 s 2.008 s -33.9%
Sequential p95 3.692 s 2.341 s -36.6%
Concurrent second-turn p50 1.867 s 1.607 s -13.9%
Turn-order slope 13.31 ms/turn 5.27 ms/turn -60.4%

The root-only change reproduced independently at 2.036-second mean and 2.053-second p50 in run 33468608676, so it accounts for almost all of the combined improvement. Exact Workflow-world coverage confirms that two root turns omit one caller resolution, two binds, and two notifications, while the delegated two-turn path retains that 1 + 2 + 2 inventory and identical results.

These are close-in-time hosted A/Bs, not interleaved statistical proof. The new report is informational until the proposed paired benchmark establishes the platform noise floor. The full research ledger also records the SDK beta.47 regression, neutral readiness and retired-cleanup trials, failed polling child join, unsafe hook/attribute coalescing attempts, and a non-mergeable topology prototype that reproduced 0.799–0.828-second p50s.

Low-risk await audit

There is no additional safe ctx.waitUntil conversion in the current Workflow hot path. Channel routes already use Nitro's request lifetime; Workflow steps expose no supported equivalent. The stress fixture's instrumentation flush is an async no-op, Workflow already group-commits adjacent stream chunks, and detaching attributes, hook operations, terminal cleanup, or provider drains would weaken ordering, retry, cancellation, or invocation-lifetime guarantees. This PR does not import Workflow's private host helper or make correctness environment-dependent.

Validation

  • node --test scripts/workflow-stress-report.test.mjs — 3 passed
  • pnpm test:unit — 7,461 passed, 1 skipped
  • pnpm --filter eve exec vitest run --config vitest.integration.config.ts src/execution/workflow-entry.integration.test.ts — 17 passed
  • pnpm typecheck
  • pnpm lint — existing unrelated warnings only
  • pnpm guard:invariants
  • pnpm docs:check
  • hosted Vercel Workflow stress control, isolated root-only confirmation, and combined candidate jobs passed and retained reports
  • the latest-head Workflow stress rerun passed after the shared-project throttle cleared; p50 was 2.036 s and concurrent second-turn p50 was 1.526 s (run, artifact)
  • required CI, the lower-concurrency Vercel rerun, and Postgres passed on the latest head; the real-model Anthropic prompt-cache eval failed twice because the model returned an empty response instead of its expected tool call

Checklist

  • This change was requested or approved by a maintainer
  • I ran the relevant checks from CONTRIBUTING.md
  • I added tests and documentation where relevant
  • I added changesets for published eve behavior
  • DCO sign-off passes for every commit (git commit --signoff)
Signed-off-by: Andrew Barba <barba@hey.com>
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
eve-docs Ready Ready Preview, v0 Sep 1, 2026 12:55pm UTC
eve-docs-4759 Ready Ready Preview, v0 Sep 1, 2026 12:55pm UTC
eve-pkg Building Building Preview, v0 Sep 1, 2026 12:55pm UTC
Signed-off-by: Andrew Barba <barba@hey.com>
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Bundle + Package Summary: apps/fixtures/weather-agent

Key takeaways

  • No notable deltas vs main (e09c721).

Delta vs main (e09c721)

Area Metric Baseline Current Delta
Package Packed tarball 8.54 MB 8.54 MB +1.1 kB ⚠️
Package Unpacked publish size 32.20 MB 32.20 MB +2.1 kB ⚠️
Package Installed footprint 77.22 MB 77.23 MB +2.1 kB ⚠️
Package Published files 3674 3676 +2
Package Installed files 7509 7511 +2
Package Installed package instances 35 35 0
Package Distinct installed package names 34 34 0
Package Installed dependency edges 53 53 0
Package Installed optional peer edges 47 47 0
Runtime Unique function payloads 2 2 0
Runtime Total function bytes 19.86 MB 19.87 MB +14.5 kB ⚠️
Runtime Public routes 17 17 0
Changed function payloads vs main (e09c721) (2)
Function Status Baseline Current Delta Route changes
functions/__server.func changed 9.93 MB 9.94 MB +7.2 kB ⚠️ none
functions/.well-known/workflow/v1/flow.func changed 9.93 MB 9.94 MB +7.2 kB ⚠️ none

eve init install

Metric Baseline Current Delta
Installed footprint 115.66 MB 115.66 MB +2.1 kB ⚠️
Installed packages 120 120 0
dependencies 4 4 0
devDependencies 2 2 0
Dependency package bytes 48.17 MB 48.17 MB +2.1 kB ⚠️
devDependency package bytes 5.04 MB 5.04 MB 0 B ➖
Build Metadata
  • Preset: vercel
  • Nitro: nitro@3.0.260610-beta
  • Output directory: apps/fixtures/weather-agent/.vercel/output
  • Build metadata timestamp: 2026-09-01T12:55:32.720Z
  • Route aliases: 17 public, 1 internal (18 total aliases)
  • Vercel routes in config: 20
  • Severity legend: 🔴 dominant/large, 🟠 notable, 🟡 watch, ⚪ small
Package Drill-Down

Package Details

  • Package: eve@0.47.6
  • Package directory: packages/eve
  • Tarball: 8.54 MB (eve-0.47.6.tgz)
  • Unpacked payload: 32.20 MB across 3676 published files
  • Installed footprint: 77.23 MB across 7511 installed files
  • Installed root package: 30.74 MB
  • Installed dependencies: 46.48 MB
  • Installed package instances: 35
  • Distinct installed package names: 34
  • Installed dependency edges: 53
  • Installed optional peer edges: 47
  • Runtime dependencies: 2
  • Peer dependencies: 5 (4 optional)

Installed footprint is measured from an isolated temporary npm install of the packed tarball.
Graph metrics read only package.json files in package directories directly beneath a node_modules boundary, including nested boundaries. Each directory is one package instance; distinct names come from those manifests. Dependency edges count each unique name in dependencies or optionalDependencies per instance; optional peer edges count peerDependencies marked optional.

Heavy installed dependencies

  • eve: 30.74 MB (39.8%)
  • @rolldown/binding-linux-x64-gnu: 19.33 MB (25.0%)
  • ai: 6.89 MB (8.9%)
  • zod: 6.41 MB (8.3%)
  • undici: 3.50 MB (4.5%)
Publish payload breakdown
Published file size
🔴 dist/src/compiled/shadcn-registry/index.js       [#############...........] 9.76 MB 30.3%
🟠 dist/src/compiled/@photon-ai/chat-adapter-ime... [###.....................] 2.27 MB 7.1%
🟠 dist/src/compiled/@ai-sdk/code-mode/index.js     [#.......................] 1.03 MB 3.2%
🟡 dist/src/compiled/@vercel/blob/index.js          [#.......................] 901.8 kB 2.8%
🟡 dist/src/compiled/_chunks/workflow/undici-Dzn... [#.......................] 512.7 kB 1.6%
🔴 Other published files                            [########################] 17.73 MB 55.1%
Installed footprint breakdown
Installed package size
🔴 eve                             [########################] 30.74 MB 39.8%
🔴 @rolldown/binding-linux-x64-gnu [###############.........] 19.33 MB 25.0%
🔴 ai                              [#####...................] 6.89 MB 8.9%
🔴 zod                             [#####...................] 6.41 MB 8.3%
🟠 undici                          [###.....................] 3.50 MB 4.5%
🟠 nitro                           [##......................] 2.41 MB 3.1%
🔴 Other installed packages        [######..................] 7.94 MB 10.3%
Runtime dependencies (2)
Package Range Notes
nitro 3.0.260610-beta
undici 8.9.0
Peer dependencies (5)
Package Range Notes
@opentelemetry/api ^1.0.0 optional peer
ai catalog:
braintrust ^3.0.0 optional peer
just-bash ^3.1.0 optional peer
microsandbox ^0.5.0 optional peer
eve init install drill-down

eve init install details

  • Command: eve init my-agent
  • Package manager: npm
  • Installed footprint: 115.66 MB across 9407 installed files
  • Installed packages: 120 total (114 transitive-only)
  • dependencies: 4 direct packages totaling 48.17 MB
  • devDependencies: 2 direct packages totaling 5.04 MB
  • Other transitive package files: 62.45 MB

Installed footprint is measured from an isolated temporary eve init my-agent using the current packed eve tarball.

Heavy installed dependencies

  • eve: 30.74 MB (26.6%)
  • @typescript/typescript-linux-x64: 27.95 MB (24.2%)
  • @rolldown/binding-linux-x64-gnu: 19.33 MB (16.7%)
  • zod: 10.37 MB (9.0%)
  • ai: 6.89 MB (6.0%)
Installed footprint breakdown
Installed package size
🔴 eve                              [########################] 30.74 MB 26.6%
🔴 @typescript/typescript-linux-x64 [######################..] 27.95 MB 24.2%
🔴 @rolldown/binding-linux-x64-gnu  [###############.........] 19.33 MB 16.7%
🔴 zod                              [########................] 10.37 MB 9.0%
🔴 ai                               [#####...................] 6.89 MB 6.0%
🟠 undici                           [###.....................] 3.50 MB 3.0%
🔴 Other installed packages         [#############...........] 16.88 MB 14.6%
dependencies (4)
Package Range Installed size Share
@vercel/connect 1.0.0 167.9 kB 0.1%
ai ^7.0.82 6.89 MB 6.0%
eve file:eve-0.47.6.tgz 30.74 MB 26.6%
zod 4.5.4 10.37 MB 9.0%
devDependencies (2)
Package Range Installed size Share
@types/node 24.x 2.54 MB 2.2%
typescript 7.0.2 2.50 MB 2.2%
Function Drill-Down

Payload Size Graph

Unique function payload size and share of total
🔴 functions/.well-known/workflow/v1/flow.func     [########################] 9.94 MB 50.0%
🔴 functions/__server.func                         [########################] 9.94 MB 50.0%

Top Function Payloads

🟠 functions/.well-known/workflow/v1/flow.func • 1 public route • 9.94 MB
Metric Value
Public routes /.well-known/workflow/v1/flow
Runtime nodejs24.x
Handler index.mjs
Payload 9.94 MB
Function files 9.94 MB across 109 files
Traced dependencies 0 B
Signal 🟠 Bundled file index.mjs is 1.98 MB (19.9%)

🟠 🔎 Dependency Analysis

📦 Bundled files:

Bundled file size
🟠 index.mjs                       [##########..............] 1.98 MB 19.9%
🟡 _libs/undici.mjs                [#####...................] 980.5 kB 9.9%
🟡 _chunks/decode_jwt-Col8JOnf.mjs [###.....................] 702.6 kB 7.1%
🟡 _chunks/frames-Dl2Hcma4.mjs     [###.....................] 678.7 kB 6.8%
🟡 _chunks/chatgpt-model.mjs       [###.....................] 667.7 kB 6.7%
🔴 Other bundled files             [########################] 4.93 MB 49.6%

🧾 Vercel Config

{
  "handler": "index.mjs",
  "launcherType": "Nodejs",
  "shouldAddHelpers": false,
  "supportsResponseStreaming": true,
  "runtime": "nodejs24.x",
  "maxDuration": "max",
  "experimentalTriggers": [
    {
      "type": "queue/v2beta",
      "topic": "__eve776561746865722d6167656e74_wkf_workflow_*",
      "consumer": "default",
      "retryAfterSeconds": 5,
      "initialDelaySeconds": 0
    }
  ],
  "environment": {
    "WORKFLOW_PRECONDITION_GUARD": "1"
  }
}

🟠 functions/__server.func • 16 public routes, 1 internal alias • 9.94 MB
Metric Value
Public routes /
/eve/v1/activity/[token]
/eve/v1/callback/[token]
/eve/v1/connections/[name]/callback/[attemptId]/[token]
/eve/v1/connections/[name]/callback/[token]
/eve/v1/health
/eve/v1/info
/eve/v1/session
/eve/v1/session/[parentSessionId]/subagents/[callId]/[childSessionId]/stream
/eve/v1/session/[sessionId]
/eve/v1/session/[sessionId]/cancel
/eve/v1/session/[sessionId]/clear
/eve/v1/session/[sessionId]/compact
/eve/v1/session/[sessionId]/reset
/eve/v1/session/[sessionId]/stream
/eve/v1/task-input/[token]
Internal aliases /__server
Runtime nodejs24.x
Handler index.mjs
Payload 9.94 MB
Function files 9.94 MB across 109 files
Traced dependencies 0 B
Signal 🟠 Bundled file index.mjs is 1.98 MB (19.9%)

🟠 🔎 Dependency Analysis

📦 Bundled files:

Bundled file size
🟠 index.mjs                       [##########..............] 1.98 MB 19.9%
🟡 _libs/undici.mjs                [#####...................] 980.5 kB 9.9%
🟡 _chunks/decode_jwt-Col8JOnf.mjs [###.....................] 702.6 kB 7.1%
🟡 _chunks/frames-Dl2Hcma4.mjs     [###.....................] 678.7 kB 6.8%
🟡 _chunks/chatgpt-model.mjs       [###.....................] 667.7 kB 6.7%
🔴 Other bundled files             [########################] 4.93 MB 49.6%

🧾 Vercel Config

{
  "handler": "index.mjs",
  "launcherType": "Nodejs",
  "shouldAddHelpers": false,
  "supportsResponseStreaming": true,
  "runtime": "nodejs24.x"
}

Build Timing: e2e/fixtures/agent-tools-sandbox

This is an informational timing measurement inside eve build, from preflight through publication. Output-size measurement and profile writing are excluded.

Build mode: deployable Vercel build with sandbox template prewarm included.

  • Build pipeline: 2.83 s -> 2.61 s (-219.9 ms) vs main (e09c721).
  • Timing is informational: shared GitHub runners are too variable for a hard timing budget.
Detailed phase timings vs `main (e09c721)`
Phase Baseline Current Delta
extension.check 1.1 ms 10.7 ms +9.6 ms
project.resolve 0.3 ms 0.3 ms 0.0 ms
workspace.create 0.7 ms 0.7 ms 0.0 ms
host.prepare 667.5 ms 594.4 ms -73.1 ms
vercel.service-prefix.resolve 2.2 ms 2.4 ms +0.2 ms
nitro.create 278.1 ms 300.8 ms +22.7 ms
sandbox.prewarm 399.0 ms 228.6 ms -170.4 ms
nitro.cache.prepare 0.3 ms 0.3 ms 0.0 ms
nitro.prepare 0.9 ms 0.8 ms -0.1 ms
nitro.public-assets 0.8 ms 0.7 ms -0.1 ms
nitro.prerender 0.6 ms 0.6 ms 0.0 ms
nitro.bundle 1.43 s 1.42 s -12.0 ms
nitro.cache.write 0.3 ms 0.4 ms +0.1 ms
vercel.workflow-function.materialize 44.7 ms 47.9 ms +3.2 ms
agent-summary.emit 0.7 ms 0.8 ms +0.1 ms
nitro.close 0.2 ms 0.2 ms 0.0 ms
output.publish 3.4 ms 3.2 ms -0.2 ms
workspace.remove 2.1 ms 2.3 ms +0.2 ms
Signed-off-by: Andrew Barba <barba@hey.com>
(cherry picked from commit 863daf1)
Signed-off-by: Andrew Barba <barba@hey.com>
(cherry picked from commit 5c3b078)
Signed-off-by: Andrew Barba <barba@hey.com>
(cherry picked from commit cf580c1)
Signed-off-by: Andrew Barba <barba@hey.com>
(cherry picked from commit c4e4fa0)
Signed-off-by: Andrew Barba <barba@hey.com>
(cherry picked from commit 57e06b2)
Signed-off-by: Andrew Barba <barba@hey.com>
(cherry picked from commit c05458d)
Signed-off-by: Andrew Barba <barba@hey.com>
Signed-off-by: Andrew Barba <barba@hey.com>
Signed-off-by: Andrew Barba <barba@hey.com>
Signed-off-by: Andrew Barba <barba@hey.com>
@vercel
vercel Bot temporarily deployed to Preview – eve-pkg September 1, 2026 04:54 Inactive
Signed-off-by: Andrew Barba <barba@hey.com>
@AndrewBarba
AndrewBarba merged commit 6a8340f into main Sep 1, 2026
117 checks passed
@AndrewBarba
AndrewBarba deleted the barba/turn-performance-tracking branch September 1, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants