mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
- 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]>
30 lines
670 B
TypeScript
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,
|
|
},
|
|
});
|