Files
bitvid/playwright.bench.config.ts
T
google-labs-jules[bot]andPR0M3TH3AN fac5e00297 feat(perf): offload explore data computation to web worker
- Moved heavy tag counting and IDF calculation to `js/workers/exploreData.worker.js`.
- Extracted `collectVideoTags` to `js/utils/videoTags.js` (preserved original behavior).
- Extracted pointer normalization logic to `js/utils/pointerNormalization.js`.
- Refactored `js/services/exploreDataService.js` to use the worker.
- Added benchmark test `tests/benchmark-explore-data.spec.mjs`.

Measured Improvement:
- `buildTagIdf` execution time on main thread reduced from ~130ms blocking to ~0ms blocking (141ms total async time).
- Unblocks UI during periodic data refreshes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 17:00:13 +00:00

30 lines
670 B
TypeScript

import { defineConfig } from "@playwright/test";
const HOST = "127.0.0.1";
const PORT = 4173;
const BASE_URL = `http://${HOST}:${PORT}`;
export default defineConfig({
testDir: "./tests",
outputDir: "artifacts/test-results-bench",
timeout: 60_000,
reporter: "list",
use: {
baseURL: BASE_URL,
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
},
projects: [
{
name: "benchmark",
testMatch: "**/*.spec.mjs",
},
],
webServer: {
command: `npx http-server . -p ${PORT} -a ${HOST} -c-1 --silent`,
url: `${BASE_URL}/docs/kitchen-sink.html`,
reuseExistingServer: true,
timeout: 120_000,
},
});