(version)
| 232 | logProgress(`Running scaling benchmark for counts: ${counts.join(', ')}`) |
| 233 | |
| 234 | const runVersion = async (version) => { |
| 235 | logProgress(`Starting ${version.toUpperCase()} run (fresh page)`) |
| 236 | const page = await createBenchmarkPage() |
| 237 | try { |
| 238 | return await page.evaluate( |
| 239 | async ({ nextVersion, nextCounts, nextTimeoutMs, nextRepeats, nextWarmups }) => { |
| 240 | const harness = window.__reactTooltipBenchmark |
| 241 | if (!harness) { |
| 242 | throw new Error('Benchmark harness was not initialized.') |
| 243 | } |
| 244 | |
| 245 | const progressPrefix = `[${nextVersion.toUpperCase()}]` |
| 246 | |
| 247 | return harness.runScalingBenchmark({ |
| 248 | version: nextVersion, |
| 249 | counts: nextCounts, |
| 250 | timeoutMs: nextTimeoutMs, |
| 251 | repeats: nextRepeats, |
| 252 | warmups: nextWarmups, |
| 253 | renderMode: 'shared', |
| 254 | onProgress: (message) => { |
| 255 | console.log(`${progressPrefix} ${message}`) |
| 256 | }, |
| 257 | }) |
| 258 | }, |
| 259 | { |
| 260 | nextVersion: version, |
| 261 | nextCounts: counts, |
| 262 | nextTimeoutMs: timeoutMs, |
| 263 | nextRepeats: repeats, |
| 264 | nextWarmups: warmups, |
| 265 | }, |
| 266 | ) |
| 267 | } finally { |
| 268 | await page.close() |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | const versions = ['v5', 'v6'] |
| 273 | // Randomize execution order to avoid first-run bias |
no test coverage detected