diff --git a/reproduce_issue.js b/reproduce_issue.js deleted file mode 100644 index 4bc011c7..00000000 --- a/reproduce_issue.js +++ /dev/null @@ -1,44 +0,0 @@ - -import { createExploreDiversitySorter } from "./js/feedEngine/sorters.js"; - -const buildItem = ({ id, score, tags }) => ({ - video: { - id: String(id), - tags: tags.map((tag) => ["t", tag]), - rootCreatedAt: 1000, - }, - metadata: { - exploreScore: score, - }, -}); - -function generateData(count) { - const items = []; - const tagsPool = ["cats", "dogs", "birds", "nature", "funny", "news", "crypto", "bitcoin", "tech", "music"]; - for (let i = 0; i < count; i++) { - const score = Math.random(); - // Assign 1-3 random tags - const numTags = Math.floor(Math.random() * 3) + 1; - const itemTags = []; - for (let t = 0; t < numTags; t++) { - itemTags.push(tagsPool[Math.floor(Math.random() * tagsPool.length)]); - } - items.push(buildItem({ id: i, score, tags: itemTags })); - } - return items; -} - -async function runBenchmark() { - const sorter = createExploreDiversitySorter({ lambda: 0.7 }); - const counts = [100, 500, 1000]; - - for (const count of counts) { - const items = generateData(count); - const start = performance.now(); - sorter(items, { addWhy() {} }); - const end = performance.now(); - console.log(`Count: ${count}, Time: ${(end - start).toFixed(2)}ms`); - } -} - -runBenchmark(); diff --git a/tests/visual/kitchen-sink.spec.ts b/tests/visual/kitchen-sink.spec.ts index 5577ac77..5b0b6e6e 100644 --- a/tests/visual/kitchen-sink.spec.ts +++ b/tests/visual/kitchen-sink.spec.ts @@ -61,7 +61,7 @@ test.describe("design system kitchen sink", () => { } }, theme.value ?? null); - await page.waitForTimeout(100); + await page.waitForTimeout(1000); const screenshotBuffer = await page.screenshot({ type: "png", @@ -156,7 +156,7 @@ test.describe("video modal mobile regression", () => { window.scrollTo(0, 0); }); - await page.waitForTimeout(100); + await page.waitForTimeout(1000); const screenshotBuffer = await page.screenshot({ type: "png",