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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
"scripts": {
"dev": "bsh dev",
"build": "pnpm --filter \"@clack/*\" run build",
"bench": "pnpm -r --workspace-concurrency=1 --if-present bench",
"bench": "vitest bench --reporter=verbose",
"format": "bsh format",
"format:check": "bsh format --check",
"lint": "bsh lint .",
"test": "bsh test"
},
"devDependencies": {
"@bomb.sh/tools": "^0.8.0",
"@codspeed/vitest-plugin": "6.1.0",
"@codspeed/vitest-plugin": "^6.1.0",
"@termless/core": "^0.10.2",
"@termless/test": "^0.10.2",
"@types/node": "^22.20.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/bench/render.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ const benchmarkOptions = {
warmupTime: 50,
warmupIterations: 2,
};

const cases = nodeCounts.flatMap((nodeCount) =>
shapes.map((shape) => ({ name: `${shape} (${nodeCount})`, nodeCount, shape })),
);

test('initial render', async ({ bench }) => {
test('initial render', { timeout: 300_000 }, async ({ bench }) => {
const entries = cases.map((benchmarkCase) => {
let fixture: UIWorkloadFixture;
return bench(
Expand All @@ -39,7 +38,8 @@ test('initial render', async ({ bench }) => {
await bench.compare(...entries, benchmarkOptions);
});

test.for(workloads)('%s', async (workload, { bench }) => {
// bump timeout for CI as it runs slower and hits Vitest's default timeout in the CodSpeed runner
test.for(workloads)('%s', { timeout: 300_000 }, async (workload, { bench }) => {
const entries = cases.map((benchmarkCase) => {
let fixture: UIWorkloadFixture;
let iteration = 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"scripts": {
"dev": "bsh dev",
"bench": "NODE_OPTIONS=--experimental-strip-types vitest bench bench/render.bench.ts --reporter=verbose --experimental.viteModuleRunner=false",
"bench": "vitest bench --config ../../vitest.config.mts --reporter=verbose",
"build": "bsh build --dts",
"format": "bsh format",
"lint": "bsh lint",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ import { defineConfig } from 'vitest/config';

export default defineConfig({
plugins: [codspeedPlugin()],
test: {
benchmark: { include: ['**/*.bench.ts'] },
experimental: { viteModuleRunner: false },
// ensure we running only one test at a time
maxWorkers: 1,
isolate: false,
},
});
Loading