Skip to content

Commit

Permalink
feature: start server and browser in parallel to improve performance (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Dec 19, 2024
1 parent 6241e6c commit 262b7fa
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/parts/MeasureMemoryInternal/MeasureMemoryInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ export const measureMemoryInternal = async ({
return
}

const server = await startServer(port, workerPath, root)

const { page, browser } = await launchBrowser(
headless,
remoteDebuggingPort,
playwrightPath
)
const [server, ctx] = await Promise.all([
startServer(port, workerPath, root),
launchBrowser(headless, remoteDebuggingPort, playwrightPath),
])

const { page, browser } = ctx
try {
await page.goto(`http://localhost:${port}`)
await waitForWorkerReady(page)
Expand Down

0 comments on commit 262b7fa

Please sign in to comment.