refactor(benchmarks): inline workloads into their .bench.ts entrypoints - #261
Merged
Merged
Conversation
…ders Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…h.ts entrypoints Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor License AgreementAll contributors are covered by a CLA. |
Contributor
Storage Benchmark Results1MB Files
View full run · SVGs available as build artifacts |
Contributor
Snapshot/Fork Benchmark Resultssmall dataset
|
Contributor
Browser Benchmark Results
View full run · SVG available as build artifact |
Contributor
Browser Throughput Benchmark Results
View full run · SVG available as build artifact |
Contributor
Sandbox Dax Benchmark Results
|
Contributor
AI Gateway Benchmark Results
View full run · SVG available as a build artifact |
Contributor
Sandbox Benchmark ResultsSequential
Staggered
Burst
View full run · SVGs available as build artifacts |
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
Each benchmark's workload lived in a sibling
*-task.tsthat the.bench.tsimported through amake*Task()factory whose only job was holding a per-participant cache closure. That indirection is gone: every entrypoint is now the whole benchmark —configplus adefineTaskwhose body is thectx.stepsequence.The factory closures became module-level
Maps (same lifetime: one process = one run), and eachdefineTaskis now explicitly typed (defineTask<ProviderConfig>) since the participant type no longer arrives via the factory's return type.Deleted (bodies moved verbatim into the entrypoint):
browser/browser-task.ts,browser/browser-throughput-task.ts,storage/storage-task.ts,storage/snapshot-fork-task.ts.Two shared modules were split along the workload/reporting line, leaving only the reporting half:
browser/throughput-benchmark.ts→ keepssummarizeIterations/emptySummary/writeThroughputResultsJson; the action loop (runThroughputIteration,runActionLoop,timeAction, nav-URL handling) moved intobrowser-throughput.bench.ts.sandbox/dax.ts→ keeps the result types,summarize,writeDaxResultsJson, and now-exportedBENCH_SCRIPT_PATH;runDaxIteration(renamedrunDaxBuild) andDAX_RESOURCE_OPTIONSmoved intodax.bench.ts.Left alone on purpose:
sandbox/tti-task.ts(shared by sequential/staggered/burst, so inlining would triplicate it),ai-gateway/phase-probe.ts(shared with the legacy JSON writer), and allproviders.ts/types.ts/scoring.ts/legacy-results.ts/generate-*svg.tsmodules.Also folds in the doc fix from the now-closed #260: header comments that still said "built on @benchsdk/runner's runBenchmark" now describe the declarative
config+taskmodel.No behavior change — same steps, same names, same
measurepayloads, sameTaskErrorcodes/data, same slugs and results paths.pnpm typecheckand both package test suites pass.Link to Devin session: https://app.devin.ai/sessions/e0be51dd272f40d5997335584c1270b3
Requested by: @HeyGarrison