Skip to content

feat(benchmarks): add memory benchmarks#7585

Open
Sheraff wants to merge 3 commits into
mainfrom
add-memory-benchmarks
Open

feat(benchmarks): add memory benchmarks#7585
Sheraff wants to merge 3 commits into
mainfrom
add-memory-benchmarks

Conversation

@Sheraff
Copy link
Copy Markdown
Collaborator

@Sheraff Sheraff commented Jun 8, 2026

Summary

  • add a new Nx-orchestrated memory benchmark package under benchmarks/memory
  • add React client repeated-navigation and React SSR repeated-requests scenarios
  • add isolated scenario artifacts, report generation, root scripts, and CI publishing workflow

Verification

  • pnpm install --lockfile-only
  • CI=1 NX_DAEMON=false pnpm nx run @benchmarks/memory:test:types --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false MEMORY_BENCH_ITERATIONS=5 MEMORY_BENCH_WARMUP_ITERATIONS=2 MEMORY_BENCH_BATCH_SIZE=5 pnpm nx run @benchmarks/memory:test:memory --outputStyle=stream --skipRemoteCache --parallel=2
  • CI=1 NX_DAEMON=false pnpm nx run @benchmarks/memory:report --outputStyle=stream --skipRemoteCache

Summary by CodeRabbit

  • New Features

    • Added memory benchmark scenarios for React (client & SSR), CLI tools to run/collect results, and commands to generate consolidated reports.
    • Added Playwright-based CI workflow to run memory benchmarks and publish structured results.
  • Chores

    • Included documentation on running benchmarks and report generation; added ignore rules for benchmark outputs.

@Sheraff Sheraff requested a review from a team as a code owner June 8, 2026 08:06
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 8, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7178b80c-ff91-468d-8254-df1bf993d391

📥 Commits

Reviewing files that changed from the base of the PR and between 734f36b and bae5e40.

📒 Files selected for processing (2)
  • benchmarks/memory/README.md
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/bench.ts
✅ Files skipped from review due to trivial changes (1)
  • benchmarks/memory/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/bench.ts

📝 Walkthrough

Walkthrough

Adds a memory benchmarking system: shared result utilities and CLI, two React scenarios (client repeated-navigation and SSR repeated-requests) with Vite/Playwright configs, a GitHub Actions workflow to run and publish results, and package/tsconfig/gitignore wiring.

Changes

Memory Benchmarks Setup and Execution

Layer / File(s) Summary
Benchmark Infrastructure & Utilities
benchmarks/memory/tools/result-utils.ts, benchmarks/memory/tools/report.ts, benchmarks/memory/tools/summary.ts, benchmarks/memory/tools/tsconfig.json, benchmarks/memory/package.json, benchmarks/memory/README.md, benchmarks/memory/*.gitignore, benchmarks/memory/tsconfig.json
Shared data model for memory samples, scenario config/metrics/results, helpers for file I/O and Git info, slope computation, formatting/printing, CLI report/summary tools, and Nx/package wiring for benchmark targets.
React Client Scenario: Build & Test Configuration
benchmarks/memory/scenarios/react/client/repeated-navigation/index.html, benchmarks/memory/scenarios/react/client/repeated-navigation/playwright.config.ts, benchmarks/memory/scenarios/react/client/repeated-navigation/vite.config.ts, benchmarks/memory/scenarios/react/client/repeated-navigation/tsconfig.json
HTML entrypoint, Playwright config with Vite preview server, Vite build settings for production-like testing, and TypeScript compilation options.
React Client Scenario: Benchmark Harness & Memory Test
benchmarks/memory/scenarios/react/client/repeated-navigation/src/main.tsx, benchmarks/memory/scenarios/react/client/repeated-navigation/tests/memory.spec.ts
TanStack Router setup, search validation, render event synchronization, global window.__memoryBenchmark.runBatch that cycles deterministic navigation patterns, and Playwright CDP-based memory profiling test that runs warmup and batches, samples memory before/after GC, and computes retained heap delta and slope.
React SSR Scenario: Routing & Build Configuration
benchmarks/memory/scenarios/react/ssr/repeated-requests/vite.config.ts, benchmarks/memory/scenarios/react/ssr/repeated-requests/tsconfig.json, benchmarks/memory/scenarios/react/ssr/repeated-requests/src/router.tsx, benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routeTree.gen.ts, benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routes/__root.tsx
File-based route tree and route modules, root route with search validation, router creation for SSR (preload/scrollRestoration disabled), Vite config using TanStack Start, and tsconfig.
React SSR Scenario: Benchmark Runner & Workload
benchmarks/memory/scenarios/react/ssr/repeated-requests/bench.ts, benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routes/*, benchmarks/memory/scenarios/react/ssr/repeated-requests/src/workload.tsx
Node benchmark that loads SSR server, generates deterministic request URLs across rotating slots, runs warmup and batched requests, forces GC/settles, samples memory (baseline/after-GC/peaks), computes retained-heap slope and metrics, and writes scenario results; route workload renders probe components and preload-disabled links.
CI Workflow & Root Integration
.github/workflows/memory-benchmarks.yml, package.json
GitHub Actions workflow triggers (push/PR path filters + manual), sets concurrency/permissions/env, installs Chromium, runs the React memory benchmark with NX targets and configured iteration settings, generates report JSONs, and publishes benchmark-action output to gh-pages on main branch pushes for TanStack org. Root package.json adds benchmark:memory scripts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • schiller-manuel
  • SeanCassiere

Poem

🐰 I hop through builds and bench the run,
Routes whirl past beneath the sun,
Server ticks and clients roam,
Memory whispers, I bring it home —
Results tucked safe, the hop is done.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(benchmarks): add memory benchmarks' clearly and concisely describes the main change—introducing a new memory benchmarking system with two React scenarios and supporting infrastructure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-memory-benchmarks

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Jun 8, 2026

View your CI Pipeline Execution ↗ for commit bae5e40

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 1m 9s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 24s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-08 09:29:50 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

🚀 Changeset Version Preview

2 package(s) bumped directly, 7 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-router 1.170.15 → 1.170.16 Changeset
@tanstack/solid-router 1.170.15 → 1.170.16 Changeset
@tanstack/react-start 1.168.25 → 1.168.26 Dependent
@tanstack/react-start-client 1.168.13 → 1.168.14 Dependent
@tanstack/react-start-rsc 0.1.24 → 0.1.25 Dependent
@tanstack/react-start-server 1.167.19 → 1.167.20 Dependent
@tanstack/solid-start 1.168.25 → 1.168.26 Dependent
@tanstack/solid-start-client 1.168.13 → 1.168.14 Dependent
@tanstack/solid-start-server 1.167.19 → 1.167.20 Dependent

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Bundle Size Benchmarks

  • Commit: 77e88a919681
  • Measured at: 2026-06-08T09:29:47.545Z
  • Baseline source: history:41e7a24f693b
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.25 KiB 0 B (0.00%) 87.11 KiB 273.59 KiB 75.96 KiB ██▂▂▂▂▂▂▁▃▃
react-router.full 90.98 KiB 0 B (0.00%) 90.84 KiB 285.48 KiB 79.13 KiB ██▇▇▇▇▇▇▁▁▁
solid-router.minimal 35.48 KiB 0 B (0.00%) 35.36 KiB 105.86 KiB 32.03 KiB ▃▃▆▆▆▆▆▆▆█▁
solid-router.full 40.53 KiB 0 B (0.00%) 40.41 KiB 121.08 KiB 36.46 KiB ██▄▄▄▄▄▄▄▅▁
vue-router.minimal 52.97 KiB 0 B (0.00%) 52.84 KiB 149.90 KiB 47.62 KiB ██▆▆▆▆▆▆▆▁▁
vue-router.full 58.96 KiB 0 B (0.00%) 58.83 KiB 168.66 KiB 52.87 KiB ██▁▁▁▁▁▁▁▅▅
react-start.minimal 101.88 KiB 0 B (0.00%) 101.75 KiB 321.90 KiB 88.14 KiB ▅▅▁▁▁▁▁▁▁██
react-start.deferred-hydration 102.62 KiB 0 B (0.00%) 101.77 KiB 323.28 KiB 88.85 KiB ▇▇▁▁▁▁▁▁▇██
react-start.full 105.27 KiB 0 B (0.00%) 105.13 KiB 331.84 KiB 91.03 KiB ▃▃▃▃████▁▁▁
react-start.rsbuild.minimal 99.59 KiB 0 B (0.00%) 99.42 KiB 316.35 KiB 85.75 KiB ▅▅██████▁▅▅
react-start.rsbuild.minimal-iife 99.99 KiB 0 B (0.00%) 99.83 KiB 317.29 KiB 86.07 KiB ▄▄██████▁▆▆
react-start.rsbuild.full 102.81 KiB 0 B (0.00%) 102.64 KiB 326.41 KiB 88.40 KiB ▄▄▅▅████▁▁▁
solid-start.minimal 49.60 KiB 0 B (0.00%) 49.47 KiB 151.93 KiB 43.79 KiB ▁▁▇▇▇▇▇▇▇█▂
solid-start.deferred-hydration 52.86 KiB 0 B (0.00%) 49.53 KiB 159.97 KiB 46.81 KiB ▁▁▆▆▆▆▆▆▆█▅
solid-start.full 55.40 KiB 0 B (0.00%) 55.27 KiB 168.97 KiB 48.80 KiB ▃▃▁▁▇▇▇▇▇█▆
vue-start.minimal 71.02 KiB 0 B (0.00%) 70.89 KiB 207.04 KiB 62.93 KiB ▂▂▁▁▁▁▁▁▁██
vue-start.full 75.01 KiB 0 B (0.00%) 74.88 KiB 219.68 KiB 66.40 KiB ▂▂▁▁▇▇▇▇▇██

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 8, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7585

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7585

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7585

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7585

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7585

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7585

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7585

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7585

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7585

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7585

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7585

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7585

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7585

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7585

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7585

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7585

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7585

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7585

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7585

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7585

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7585

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7585

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7585

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7585

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7585

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7585

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7585

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7585

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7585

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7585

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7585

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7585

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7585

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7585

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7585

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7585

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7585

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7585

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7585

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7585

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7585

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7585

commit: bae5e40

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
benchmarks/memory/tools/result-utils.ts (1)

274-290: 💤 Low value

Simplify redundant type check.

Lines 282-283 check both typeof result.metrics.peakRssBytes === 'number' and Number.isFinite(result.metrics.peakRssBytes). The Number.isFinite() check already returns false for non-number types, making the typeof check redundant.

♻️ Proposed simplification
     extra: [
       `slope=${Math.round(result.metrics.retainedHeapSlopeBytesPerOperation)} B/op`,
       `peak_heap=${Math.round(result.metrics.peakHeapUsedBytes)} B`,
-      typeof result.metrics.peakRssBytes === 'number' &&
-      Number.isFinite(result.metrics.peakRssBytes)
+      Number.isFinite(result.metrics.peakRssBytes)
         ? `peak_rss=${Math.round(result.metrics.peakRssBytes)} B`
         : undefined,
     ]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/memory/tools/result-utils.ts` around lines 274 - 290, In
toBenchmarkAction, simplify the conditional that builds the extra array by
removing the redundant typeof check for result.metrics.peakRssBytes and only use
Number.isFinite(result.metrics.peakRssBytes) to guard the `peak_rss=` entry;
update the ternary that currently reads `typeof ... === 'number' &&
Number.isFinite(...) ? ... : undefined` to just
`Number.isFinite(result.metrics.peakRssBytes) ? \`peak_rss=...\` : undefined`,
referencing the result.metrics.peakRssBytes and toBenchmarkAction symbols.
benchmarks/memory/package.json (2)

28-28: 💤 Low value

Consider using caret range for @types/node to match other type packages.

The @types/node package is pinned to exact version 25.0.9 without a caret, while other type packages like @types/react and @types/react-dom use caret ranges. For consistency and to allow patch updates, consider using ^25.0.9.

♻️ Suggested consistency improvement
-    "`@types/node`": "25.0.9",
+    "`@types/node`": "^25.0.9",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/memory/package.json` at line 28, The package.json dependency entry
for "`@types/node`" is pinned to "25.0.9" while other type packages use caret
ranges; update the "`@types/node`" version string to use a caret range (e.g.,
"^25.0.9") so it matches the style of "`@types/react`" and "`@types/react-dom`" and
allows patch/minor updates while preserving major version compatibility.

32-32: TypeScript ^6.0.2 availability is OK; confirm it’s the intended benchmark target
TypeScript 6.0.2 exists on npm, so the dependency is resolvable. Confirm the project intentionally targets the 6.x line for these benchmarks (and that the caret range ^6.0.2 is desired).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/memory/package.json` at line 32, The package.json dependency
"typescript": "^6.0.2" should be explicitly verified as the intended benchmark
target; either confirm and document that benchmarks target the 6.x line (e.g.,
update the repo README or a benchmarks/README note) or change the dependency to
the desired semver (pin to "6.0.2" if exact, or broaden/narrow the range) in
package.json so the intent is clear; update any CI/test configs that assume a
different TypeScript major version accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@benchmarks/memory/scenarios/react/client/repeated-navigation/src/main.tsx`:
- Around line 160-164: The navigateAndWait function's options parameter is typed
as any — replace it with the proper NavigateOptions type exported by TanStack
Router: update the function signature navigateAndWait(options: NavigateOptions)
and add an import for the type (import type { NavigateOptions } from
'`@tanstack/router`'); ensure any call sites still pass the same object shape and
adjust or cast them only if necessary.

---

Nitpick comments:
In `@benchmarks/memory/package.json`:
- Line 28: The package.json dependency entry for "`@types/node`" is pinned to
"25.0.9" while other type packages use caret ranges; update the "`@types/node`"
version string to use a caret range (e.g., "^25.0.9") so it matches the style of
"`@types/react`" and "`@types/react-dom`" and allows patch/minor updates while
preserving major version compatibility.
- Line 32: The package.json dependency "typescript": "^6.0.2" should be
explicitly verified as the intended benchmark target; either confirm and
document that benchmarks target the 6.x line (e.g., update the repo README or a
benchmarks/README note) or change the dependency to the desired semver (pin to
"6.0.2" if exact, or broaden/narrow the range) in package.json so the intent is
clear; update any CI/test configs that assume a different TypeScript major
version accordingly.

In `@benchmarks/memory/tools/result-utils.ts`:
- Around line 274-290: In toBenchmarkAction, simplify the conditional that
builds the extra array by removing the redundant typeof check for
result.metrics.peakRssBytes and only use
Number.isFinite(result.metrics.peakRssBytes) to guard the `peak_rss=` entry;
update the ternary that currently reads `typeof ... === 'number' &&
Number.isFinite(...) ? ... : undefined` to just
`Number.isFinite(result.metrics.peakRssBytes) ? \`peak_rss=...\` : undefined`,
referencing the result.metrics.peakRssBytes and toBenchmarkAction symbols.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 544b5d15-aa37-4ef5-a368-71ea28b7f992

📥 Commits

Reviewing files that changed from the base of the PR and between 6f1daf5 and 734f36b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (29)
  • .github/workflows/memory-benchmarks.yml
  • benchmarks/memory/.gitignore
  • benchmarks/memory/README.md
  • benchmarks/memory/package.json
  • benchmarks/memory/results/.gitignore
  • benchmarks/memory/results/scenarios/.gitkeep
  • benchmarks/memory/scenarios/react/client/repeated-navigation/index.html
  • benchmarks/memory/scenarios/react/client/repeated-navigation/playwright.config.ts
  • benchmarks/memory/scenarios/react/client/repeated-navigation/src/main.tsx
  • benchmarks/memory/scenarios/react/client/repeated-navigation/tests/memory.spec.ts
  • benchmarks/memory/scenarios/react/client/repeated-navigation/tsconfig.json
  • benchmarks/memory/scenarios/react/client/repeated-navigation/vite.config.ts
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/bench.ts
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routeTree.gen.ts
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/router.tsx
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routes/$a.$b.$c.$d.tsx
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routes/$a.$b.$c.tsx
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routes/$a.$b.tsx
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routes/$a.tsx
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/routes/__root.tsx
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/src/workload.tsx
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/tsconfig.json
  • benchmarks/memory/scenarios/react/ssr/repeated-requests/vite.config.ts
  • benchmarks/memory/tools/report.ts
  • benchmarks/memory/tools/result-utils.ts
  • benchmarks/memory/tools/summary.ts
  • benchmarks/memory/tools/tsconfig.json
  • benchmarks/memory/tsconfig.json
  • package.json

Comment on lines +160 to +164
async function navigateAndWait(options: any) {
const rendered = waitForRendered()
await router.navigate(options)
await rendered
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace any type with proper NavigateOptions type.

The options parameter uses any, which violates the TypeScript strict mode guideline. TanStack Router exports a NavigateOptions type that should be used instead.

🔧 Proposed fix
+import type { NavigateOptions } from '`@tanstack/react-router`'
+
 // ... rest of imports ...

-async function navigateAndWait(options: any) {
+async function navigateAndWait(options: NavigateOptions) {
   const rendered = waitForRendered()
   await router.navigate(options)
   await rendered
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async function navigateAndWait(options: any) {
const rendered = waitForRendered()
await router.navigate(options)
await rendered
}
async function navigateAndWait(options: NavigateOptions) {
const rendered = waitForRendered()
await router.navigate(options)
await rendered
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/memory/scenarios/react/client/repeated-navigation/src/main.tsx`
around lines 160 - 164, The navigateAndWait function's options parameter is
typed as any — replace it with the proper NavigateOptions type exported by
TanStack Router: update the function signature navigateAndWait(options:
NavigateOptions) and add an import for the type (import type { NavigateOptions }
from '`@tanstack/router`'); ensure any call sites still pass the same object shape
and adjust or cast them only if necessary.

Source: Coding guidelines

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

We investigated this failure and determined it is unrelated to the PR's changes, which only add memory benchmark infrastructure and register a new workspace package. The failing SolidStart e2e test concerns Unicode routing behavior that is not touched by any file in this diff. We are classifying this as a pre-existing environment issue that should be re-run or investigated independently.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 8, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing add-memory-benchmarks (bae5e40) with main (41e7a24)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (6f1daf5) during the generation of this report, so 41e7a24 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant