Skip to content

Commit 2217f7c

Browse files
authored
test: client nav benchmark can detect granular re-rendering changes (#6808)
1 parent 3318878 commit 2217f7c

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

benchmarks/client-nav/react/speed.bench.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ describe('client-nav', () => {
3030
return navigate({
3131
to: '/$id',
3232
params: { id: nextId },
33-
search: { id: nextId },
33+
// update search every 2 navigations, to still test them, but also measure the impact of granular re-rendering
34+
search: { id: Math.floor(nextId / 2) },
3435
replace: true,
3536
})
3637
}

benchmarks/client-nav/solid/speed.bench.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ describe('client-nav', () => {
3030
})
3131

3232
next = () => {
33-
const nextId = String(id++)
33+
const nextId = id++
3434

3535
return navigate({
3636
to: '/$id',
3737
params: { id: nextId },
38-
search: { id: nextId },
38+
// update search every 2 navigations, to still test them, but also measure the impact of granular re-rendering
39+
search: { id: Math.floor(nextId / 2) },
3940
replace: true,
4041
})
4142
}

benchmarks/client-nav/vue/speed.bench.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ describe('client-nav', () => {
2929
return navigate({
3030
to: '/$id',
3131
params: { id: nextId },
32-
search: { id: nextId },
32+
// update search every 2 navigations, to still test them, but also measure the impact of granular re-rendering
33+
search: { id: Math.floor(nextId / 2) },
3334
replace: true,
3435
})
3536
}

0 commit comments

Comments
 (0)