Skip to content
Open
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 benchmarks/client-nav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
"vue": "^3.5.16"
},
"devDependencies": {
"@codspeed/vitest-plugin": "^5.3.0",
"@platformatic/flame": "^1.6.0",
"@codspeed/vitest-plugin": "^5.0.1",
"@testing-library/react": "^16.2.0",
"@types/jsdom": "28.0.0",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue": "^6.0.5",
"@vitejs/plugin-vue-jsx": "^5.1.5",
"@types/jsdom": "28.0.0",
"typescript": "^6.0.2",
"vite": "^8.0.0",
"vite-plugin-solid": "^2.11.11",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"vue": "^3.5.16"
},
"devDependencies": {
"@codspeed/vitest-plugin": "^5.0.1",
"@codspeed/vitest-plugin": "^5.3.0",
"@vitejs/plugin-react": "^6.0.1",
"@vitejs/plugin-vue-jsx": "^5.1.5",
"typescript": "^6.0.2",
Expand Down
31 changes: 27 additions & 4 deletions benchmarks/ssr/react/speed.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,34 @@ const uninitializedHandler: StartRequestHandler = {
let handler = uninitializedHandler

async function setup() {
const module = (await import(appModulePath)) as {
default: StartRequestHandler
const start = performance.now()
const timer = setInterval(() => {
console.error(
`[react ssr benchmark] still importing ${appModulePath} after ${Math.round(
performance.now() - start,
)}ms`,
)
}, 1_000)

if (typeof timer === 'object') {
timer.unref?.()
}

handler = module.default
try {
const module = (await import(appModulePath)) as {
default: StartRequestHandler
}

console.error(
`[react ssr benchmark] imported ${appModulePath} in ${Math.round(
performance.now() - start,
)}ms`,
)

handler = module.default
} finally {
clearInterval(timer)
}
}

function teardown() {
Expand All @@ -33,7 +56,7 @@ describe('ssr', () => {
*
* So it looks like we're setting up in duplicate, but in reality, it's only running once per environment, as intended.
*/
beforeAll(setup)
beforeAll(setup, 60_000)
afterAll(teardown)

bench(
Expand Down
85 changes: 52 additions & 33 deletions pnpm-lock.yaml

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

Loading