Open History to see the last commit
1import { test } from 'vitest'
2import { runSsrRequestLoop } from '../bench-utils'
3import type { StartRequestHandler } from '../bench-utils'
4β
5const appModuleUrl = new URL('./dist/server/server.js', import.meta.url).href
6const benchmarkSeed = 0xdecafbad
7β
8const { default: handler } = (await import(
9 /* @vite-ignore */ appModuleUrl
10)) as {
11 default: StartRequestHandler
12}
13β
14test('ssr', async ({ bench }) => {
15 await bench('ssr request loop (react)', async () =>
16 runSsrRequestLoop(handler, { seed: benchmarkSeed }),
17 ).run({
18 warmupIterations: 100,
19 time: 10_000,
20 throws: true,
21 })
22})