Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changeset/changesets-3-and-tinybench-6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"$schema": "https://unpkg.com/@changesets/config@4.0.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ jobs:
- run: pnpm install --frozen-lockfile
- run: pnpm check
- id: changesets
uses: changesets/action@v1
uses: changesets/action@v2.1.2
with:
version: pnpm version-packages
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
version-script: pnpm version-packages
publish-script: pnpm release
github-token: ${{ secrets.GITHUB_TOKEN }}

deploy-website:
needs: release
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"release": "pnpm build && changeset publish"
},
"devDependencies": {
"@changesets/cli": "2.31.0",
"@changesets/cli": "3.0.3",
"@effect/vitest": "4.1.1",
"@typeonce/oxlint-plugin-effect-machine": "workspace:*",
"@types/node": "26.6.6",
Expand All @@ -45,7 +45,7 @@
"oxlint": "1.90.0",
"oxlint-tsgolint": "7.0.2005",
"pagefind": "1.5.2",
"tinybench": "2.9.0",
"tinybench": "6.2.2",
"tstyche": "7.2.5",
"typedoc": "0.28.20",
"typescript": "6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/effect-machine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@effect/vitest": "4.1.1",
"@types/node": "26.6.6",
"effect": "4.1.1",
"tinybench": "2.9.0",
"tinybench": "6.2.2",
"tstyche": "7.2.5",
"typescript": "6.0.3",
"vitest": "5.0.5"
Expand Down
896 changes: 209 additions & 687 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

24 changes: 15 additions & 9 deletions scripts/runtime-performance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const bench = new Bench({
warmupTime: configuration.warmupTimeMilliseconds,
iterations: configuration.minimumIterations,
warmupIterations: configuration.minimumWarmupIterations,
retainSamples: true,
throws: true
})
const benchmarkDefinitions = new Map()
Expand Down Expand Up @@ -334,7 +335,7 @@ for (const implementation of runtimeReferenceImplementations) {
}

try {
await bench.warmup()
// Bench.run warms every task up before measuring it.
await bench.run()
} finally {
for (const implementation of implementations) {
Expand Down Expand Up @@ -373,21 +374,26 @@ const benchmarks = bench.tasks.map((task) => {
if (definition === undefined || result === undefined) {
throw new Error(`Missing benchmark result for ${task.name}`)
}
if (result.error !== undefined) {
if (result.state === "errored") {
throw result.error
}
if (result.state !== "completed" || result.latency.samples === undefined) {
throw new Error(`Benchmark ${task.name} did not complete: ${result.state}`)
}
const operations = definition.operationsPerIteration
const medianBatchMilliseconds = percentile(result.samples, 0.5)
const { latency } = result
const samples = latency.samples
const medianBatchMilliseconds = percentile(samples, 0.5)
return {
...definition,
medianThroughput: operations * 1_000 / medianBatchMilliseconds,
meanThroughput: result.hz * operations,
meanNanosecondsPerOperation: result.mean * 1_000_000 / operations,
meanThroughput: operations * 1_000 / latency.mean,
meanNanosecondsPerOperation: latency.mean * 1_000_000 / operations,
medianBatchMilliseconds,
p95BatchMilliseconds: percentile(result.samples, 0.95),
p99BatchMilliseconds: result.p99,
relativeMarginOfError: result.rme,
sampleCount: result.samples.length
p95BatchMilliseconds: percentile(samples, 0.95),
p99BatchMilliseconds: percentile(samples, 0.99),
relativeMarginOfError: latency.rme,
sampleCount: samples.length
}
})

Expand Down
Loading