Repository navigation
Add hostperf cross-runtime benchmark suite - #11014
Merged
Merged
Conversation
|
…inconclusive verdict
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
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.
Adds
pnpm hostperf, a benchmark suite that runs the same Effect cases in Node.js, Bun, Chromium and WebKit, writes a JSON report and can compare against an earlier report.Closes EFF-4649
What's in it
packages/effect/benchmark/hostperf/:cases.ts:Effect/yield,Effect/forkJoin,Queue/queueTake,Pool/get and release (fixed pool),Pool/poolUseContended,HashMap/set n fresh string keys + get all,Schema/decode struct (valid),app/app-untraced. Each case validates its result before and after timing.harness.ts: portable measurement loop (performance.now()only): warmup, batch calibration, timed samples.entry.ts: bundle entry exposing the runner onglobalThis.run.ts: CLI. Bundles once with Vite so every host runs identical code, then runs each case in a fresh process (Node.js, Bun) or browser context (Playwright), for 3 rounds.stats.ts: speedup with a hierarchical bootstrap interval (rounds, then samples), so noise between processes widens the interval.Usage
A full run on three hosts takes about 34s (node 9s, bun 7s, chromium 17s). A same-tree comparison reported all 24 host/case pairs as
same.Chromium shows
Effect.yieldNowat about 4 ms per yield, against roughly 1.3 µs in Node.js. That looks like nestedsetTimeoutclamping in the scheduler, and it's the kind of gap this suite is meant to catch.Notes for reviewers
errorsand the command exits 1.benchmark/.