Skip to content

Commit

Permalink
remove profiling for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ricokahler committed Sep 24, 2024
1 parent b451cf1 commit 5c98d06
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions perf/efps/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import sourcemaps from 'rollup-plugin-sourcemaps'
import handler from 'serve-handler'
import * as vite from 'vite'

import {remapCpuProfile} from './helpers/remapCpuProfile'
import {type EfpsResult, type EfpsTest, type EfpsTestRunnerContext} from './types'

const workspaceDir = path.dirname(fileURLToPath(import.meta.url))
Expand Down Expand Up @@ -109,7 +108,7 @@ export async function runTest({
typeof test.document === 'function' ? await test.document(runnerContext) : test.document
document = await client.create(documentToCreate)

const cdp = await context.newCDPSession(page)
// const cdp = await context.newCDPSession(page)

log('Loading editor…')
await page.goto(
Expand All @@ -118,31 +117,31 @@ export async function runTest({
)};type=${encodeURIComponent(documentToCreate._type)}`,
)

await cdp.send('Profiler.enable')
await cdp.send('Profiler.start')
// await cdp.send('Profiler.enable')
// await cdp.send('Profiler.start')

log('Benchmarking…')
const result = await test.run({...runnerContext, document})

log('Saving results…')
const results = Array.isArray(result) ? result : [result]

const {profile} = await cdp.send('Profiler.stop')
const remappedProfile = await remapCpuProfile(profile, outDir)
// const {profile} = await cdp.send('Profiler.stop')
// const remappedProfile = await remapCpuProfile(profile, outDir)

await fs.promises.mkdir(testResultsDir, {recursive: true})
await fs.promises.writeFile(
path.join(testResultsDir, 'results.json'),
JSON.stringify(results, null, 2),
)
await fs.promises.writeFile(
path.join(testResultsDir, 'raw.cpuprofile'),
JSON.stringify(profile),
)
await fs.promises.writeFile(
path.join(testResultsDir, 'mapped.cpuprofile'),
JSON.stringify(remappedProfile),
)
// await fs.promises.writeFile(
// path.join(testResultsDir, 'raw.cpuprofile'),
// JSON.stringify(profile),
// )
// await fs.promises.writeFile(
// path.join(testResultsDir, 'mapped.cpuprofile'),
// JSON.stringify(remappedProfile),
// )

spinner.succeed(`Ran benchmark '${test.name}' (${versionLabel})`)

Expand Down

0 comments on commit 5c98d06

Please sign in to comment.