Skip to content

[release-2.1] perf(ui): fix performance issue with high number of pages - #5933

Merged
openshift-merge-bot[bot] merged 4 commits into
redhat-developer:release-2.1from
christoph-jerolimov:sidebar-performance-release-2.1
Dec 1, 2026
Merged

openshift-merge-bot[bot] merged 4 commits into
redhat-developer:release-2.1from
christoph-jerolimov:sidebar-performance-release-2.1

Conversation

@christoph-jerolimov

@christoph-jerolimov christoph-jerolimov commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Summary

While migrating to the New Frontend System we noticed some degradation in the frontend reaction time, esp. when switching between routes. This happen when switching between pages but also when switching between catalog tabs.

There was two main issues:

  1. Switching routes re-renders all SidebarItems. The call to makeSidebarStyles is already memorized, but since it should be the same for all SidebarItem's we could get one step further and reuse the same classes for all. To be 100% backward compatible it stringifies the config and use this as cache-key.

    Then I switched from Material UI Box to div and span because its adds always another style calculation even the Box has no prop here except the style classnames.

    As example, for "50 pages with sidebar items" it took (on my machine) 2160 ms before and 621 ms with both fixes.

    This fix was accepted upstream as https://github.com/backstage/backstage/pull/37175 and will be part of Backstage 1.58.

  2. Another routing issue was already fixed in Backstage 1.57 by @schultzp2020 but for 1.49 we need a routing fix as well.

Which issue(s) does this PR fix

Benchmark

The first PR adds a unit test that can be started with yarn test:bench that confirms that this reduce the (re) rendering time.

Before (0fa365f)

PASS src/scale.bench.test.tsx (179.493 s)
  frontend system scale benchmark
    ✓ measures app tree creation and route resolution (15682 ms)
    route changes
      ✓ warmup (664 ms)
      ✓ 2 pages with sidebar items (406 ms)
      ✓ 2 pages without sidebar items (338 ms)
      ✓ 2 entity contents (316 ms)
      ✓ 2 pages and 2 entity contents (383 ms)
      ✓ 10 pages with sidebar items (653 ms)
      ✓ 10 pages without sidebar items (364 ms)
      ✓ 10 entity contents (379 ms)
      ✓ 10 pages and 10 entity contents (666 ms)
      ✓ 50 pages with sidebar items (1928 ms)
      ✓ 50 pages without sidebar items (370 ms)
      ✓ 50 entity contents (465 ms)
      ✓ 50 pages and 50 entity contents (2349 ms)
      ✓ 100 pages with sidebar items (4298 ms)
      ✓ 100 pages without sidebar items (465 ms)
      ✓ 100 entity contents (666 ms)
      ✓ 100 pages and 100 entity contents (5505 ms)
      ✓ 200 pages with sidebar items (12631 ms)
      ✓ 200 pages without sidebar items (732 ms)
      ✓ 200 entity contents (1167 ms)
      ✓ 200 pages and 200 entity contents (17318 ms)
      ✓ 400 pages with sidebar items (43585 ms)
      ✓ 400 pages without sidebar items (1174 ms)
      ✓ 400 entity contents (1912 ms)
      ✓ 400 pages and 400 entity contents (60865 ms)

First fix (7a6cc04)

PASS src/scale.bench.test.tsx (141.581 s)
  frontend system scale benchmark
    ✓ measures app tree creation and route resolution (17372 ms)
    route changes
      ✓ warmup (753 ms)
      ✓ 2 pages with sidebar items (505 ms)
      ✓ 2 pages without sidebar items (439 ms)
      ✓ 2 entity contents (399 ms)
      ✓ 2 pages and 2 entity contents (451 ms)
      ✓ 10 pages with sidebar items (605 ms)
      ✓ 10 pages without sidebar items (354 ms)
      ✓ 10 entity contents (369 ms)
      ✓ 10 pages and 10 entity contents (615 ms)
      ✓ 50 pages with sidebar items (1715 ms)
      ✓ 50 pages without sidebar items (426 ms)
      ✓ 50 entity contents (605 ms)
      ✓ 50 pages and 50 entity contents (1618 ms)
      ✓ 100 pages with sidebar items (3050 ms)
      ✓ 100 pages without sidebar items (463 ms)
      ✓ 100 entity contents (739 ms)
      ✓ 100 pages and 100 entity contents (4183 ms)
      ✓ 200 pages with sidebar items (8894 ms)
      ✓ 200 pages without sidebar items (702 ms)
      ✓ 200 entity contents (1046 ms)
      ✓ 200 pages and 200 entity contents (12933 ms)
      ✓ 400 pages with sidebar items (30755 ms)
      ✓ 400 pages without sidebar items (1154 ms)
      ✓ 400 entity contents (2174 ms)
      ✓ 400 pages and 400 entity contents (44353 ms)

Second fix (6c71fff)

PASS src/scale.bench.test.tsx (57.76 s)
  frontend system scale benchmark
    ✓ measures app tree creation and route resolution (17233 ms)
    route changes
      ✓ warmup (648 ms)
      ✓ 2 pages with sidebar items (387 ms)
      ✓ 2 pages without sidebar items (368 ms)
      ✓ 2 entity contents (333 ms)
      ✓ 2 pages and 2 entity contents (361 ms)
      ✓ 10 pages with sidebar items (445 ms)
      ✓ 10 pages without sidebar items (314 ms)
      ✓ 10 entity contents (331 ms)
      ✓ 10 pages and 10 entity contents (470 ms)
      ✓ 50 pages with sidebar items (998 ms)
      ✓ 50 pages without sidebar items (376 ms)
      ✓ 50 entity contents (464 ms)
      ✓ 50 pages and 50 entity contents (975 ms)
      ✓ 100 pages with sidebar items (1399 ms)
      ✓ 100 pages without sidebar items (382 ms)
      ✓ 100 entity contents (653 ms)
      ✓ 100 pages and 100 entity contents (1933 ms)
      ✓ 200 pages with sidebar items (2720 ms)
      ✓ 200 pages without sidebar items (465 ms)
      ✓ 200 entity contents (934 ms)
      ✓ 200 pages and 200 entity contents (3541 ms)
      ✓ 400 pages with sidebar items (5421 ms)
      ✓ 400 pages without sidebar items (482 ms)
      ✓ 400 entity contents (1212 ms)
      ✓ 400 pages and 400 entity contents (10059 ms)

Route fix (7571e8d)

PASS src/scale.bench.test.tsx (25.816 s)
  frontend system scale benchmark
    ✓ measures app tree creation and route resolution (770 ms)
    route changes
      ✓ warmup (573 ms)
      ✓ 2 pages with sidebar items (344 ms)
      ✓ 2 pages without sidebar items (319 ms)
      ✓ 2 entity contents (313 ms)
      ✓ 2 pages and 2 entity contents (293 ms)
      ✓ 10 pages with sidebar items (366 ms)
      ✓ 10 pages without sidebar items (319 ms)
      ✓ 10 entity contents (279 ms)
      ✓ 10 pages and 10 entity contents (361 ms)
      ✓ 50 pages with sidebar items (671 ms)
      ✓ 50 pages without sidebar items (275 ms)
      ✓ 50 entity contents (373 ms)
      ✓ 50 pages and 50 entity contents (808 ms)
      ✓ 100 pages with sidebar items (1154 ms)
      ✓ 100 pages without sidebar items (301 ms)
      ✓ 100 entity contents (609 ms)
      ✓ 100 pages and 100 entity contents (1178 ms)
      ✓ 200 pages with sidebar items (1541 ms)
      ✓ 200 pages without sidebar items (272 ms)
      ✓ 200 entity contents (629 ms)
      ✓ 200 pages and 200 entity contents (1856 ms)
      ✓ 400 pages with sidebar items (2965 ms)
      ✓ 400 pages without sidebar items (383 ms)
      ✓ 400 entity contents (1001 ms)
      ✓ 400 pages and 400 entity contents (3711 ms)

Performance tests on a cluster

2.1.0 cold 39.8s goes down to 27.2s, and next warm 15.8s goes down to 7.9s.

release-2.1 @ c7a1027 (RHDH Version: 2.1.0, Backstage Version: 1.54.9)

Step Durations

Step Count Avg P90 Min Max
cold 20 39.8s 42.8s 37.3s 43.1s
cold/login 20 20.9s 21.2s 20.6s 21.3s
cold/home 20 4.7s 5.4s 4.1s 5.7s
cold/catalog 20 7.6s 9.4s 6.4s 9.8s
cold/component 20 3.0s 3.6s 2.5s 3.9s
cold/catalog-tab-n 20 1.7s 2.0s 1.5s 2.5s
cold/page-n 20 1.9s 2.4s 1.4s 2.4s
logout 20 503ms 618ms 420ms 667ms
warm 20 15.8s 20.1s 12.3s 25.8s
warm/login 20 2.5s 3.0s 2.2s 3.1s
warm/home 20 3.2s 4.5s 2.4s 5.5s
warm/catalog 20 5.3s 6.9s 3.4s 9.0s
warm/component 20 2.4s 2.8s 1.9s 5.1s
warm/catalog-tab-n 20 1.1s 1.7s 654ms 1.9s
warm/page-n 20 1.4s 2.1s 1.1s 2.2s
all 20 56.8s 60.6s 50.9s 69.2s

Network Stats (based on 20 runs)

Metric Sum Avg
consoleMessages 26140 1307.0
requests 31122 1556.1
requestsFailed 1 0.1
requestsFinished 31119 1556.0
responses 31119 1556.0
responseSizeSumKb 252338.58000000005 12616.9
responseSizeMaxKb 8217.939999999999 410.9
responseTimeSumSec 64537.44 3226.9
responseTimeAvgSec 41.470000000000006 2.1

perDomain

Key Sum Avg
same-domain 30560 1528.0
cdn.segment.com 120 6.0
api.segment.io 441 22.1

perResourceType

Key Sum Avg
document 60 3.0
stylesheet 500 25.0
script 27964 1398.2
fetch 2416 120.8
font 132 6.6
image 49 2.5

perStatusCode

Key Sum Avg
200 31081 1554.0
304 40 2.0

5933 @ 7571e8d (RHDH Version: 2.1.1, Backstage Version: 1.54.9)

Step Durations

Step Count Avg P90 Min Max
cold 20 27.2s 27.8s 26.4s 28.2s
cold/login 20 20.9s 21.0s 20.7s 21.1s
cold/home 20 1.4s 1.5s 1.3s 1.5s
cold/catalog 20 2.5s 2.8s 1.9s 3.0s
cold/component 20 1.6s 2.3s 1.1s 2.4s
cold/catalog-tab-n 20 370ms 450ms 239ms 615ms
cold/page-n 20 436ms 508ms 351ms 588ms
logout 20 368ms 441ms 258ms 745ms
warm 20 7.9s 8.5s 6.6s 9.1s
warm/login 20 2.7s 3.0s 2.0s 3.4s
warm/home 20 764ms 860ms 584ms 986ms
warm/catalog 20 2.3s 2.7s 1.3s 3.2s
warm/component 20 1.3s 1.8s 877ms 1.9s
warm/catalog-tab-n 20 354ms 515ms 221ms 683ms
warm/page-n 20 434ms 515ms 353ms 579ms
all 20 36.2s 37.2s 34.6s 37.4s

Network Stats (based on 20 runs)

Metric Sum Avg
consoleMessages 438 21.9
requests 30897 1544.8
requestsFailed 165 8.3
requestsFinished 30730 1536.5
responses 30732 1536.6
responseSizeSumKb 251077.63000000003 12553.9
responseSizeMaxKb 8243.08 412.2
responseTimeSumSec 62604.13 3130.2
responseTimeAvgSec 40.83 2.0

perDomain

Key Sum Avg
same-domain 30736 1536.8

perResourceType

Key Sum Avg
document 60 3.0
script 28041 1402.0
stylesheet 505 25.3
fetch 1951 97.5
font 129 6.5
image 50 2.5

perStatusCode

Key Sum Avg
200 30641 1532.0
304 95 4.8

Evidence

See above. Performance improvement is high. The fix has a low risk to break somewthing.

Testing

Deploy the PR on a cluster

Use https://github.com/redhat-developer/rhdh-loadtest to deploy it with 200 plugins and run the included tests against it.

Merge Danger

Door: one-way or two-way (can we walk back through it?)

We can go back and remove this at any point if this introduce any other issue.

Blast radius: one-word scope of impact

Full app because it affects the page routing

How to revert

Revert the merge commit, no flag.

PR acceptance criteria

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features) not needed
  • Add a screenshot if the change is UX/UI related not needed

How to test changes / Special notes to the reviewer

Deploy the PR on a cluster

Use https://github.com/redhat-developer/rhdh-loadtest to deploy it with 200 plugins and run the included tests against it.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Add opt-in frontend system scale benchmark

🧪 Tests ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Add an opt-in benchmark for app creation, route resolution, and rendered navigation as extensions
 scale.
• Compare sidebar, page, and entity-content scenarios using configurable benchmark sizes and series.
• Add workspace commands to run the benchmark separately from routine tests.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 2 capabilities

  • 2 affected capabilities span independent functional scopes: frontend-navigation-sidebar, frontend-routing-navigation.
  • The cache and wrapper changes affect the same end-to-end sidebar presentation behavior across open, closed, selected, notification, and submenu states; they do not reach unrelated application domains.
  • The changed resolver produces route paths consumed by the frontend application's route API and navigation flows; it is one bounded routing integration rather than separate capabilities for the resolver and its callers.
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before, each sidebar configuration created its own style hook and Box wrappers rendered the icon structure.
  • After, serialized configurations share hooks and native wrappers render the same open, closed, selected, notification, and submenu states.
  • The new correctness condition is that equal keys share compatible styles without changing the expected CSS or DOM structure.
Potential damage 🟡 Medium 🩹 Incorrect results

  • If cached matches become stale or are associated with the wrong source location, generated links can point to incorrect frontend paths or fail to resolve; no persistent state or external side effect is changed.
  • Reverting the patched dependency restores uncached matching.
  • Affected in-memory route results disappear on page reload or application restart, with no stored-data repair required.
Assessed commit 7571e8d
Diagram

graph TD
  CMD["Benchmark command"] --> GATE{"BENCH enabled?"} -->|yes| SUITE["Scale suite"] --> FEATURES["Synthetic plugins"] --> APP["Specialized app"]
  APP --> WIRING["Wiring timings"]
  APP --> NAV["Navigation timings"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Browser-based benchmark
  • ➕ Measures user-visible navigation in a production-like browser environment.
  • ➖ Requires more infrastructure and makes controlled extension-count comparisons harder to reproduce.

Recommendation: Keep the opt-in Jest benchmark for comparing relative scaling under controlled workloads. Use a browser benchmark separately if the goal becomes measuring absolute user-facing performance; jsdom timings should not be interpreted as browser timings.

Files changed (3) +498 / -0

Tests (1) +496 / -0
scale.bench.test.tsxBenchmark frontend wiring and navigation at scale +496/-0

Benchmark frontend wiring and navigation at scale

• Adds a BENCH-gated Jest suite that generates plugins, pages, entity content, and modules to measure app creation and route resolution. It also renders the app with a mocked catalog API and reports first-render and navigation timings across configurable sizes and sidebar/content scenarios.

packages/app/src/scale.bench.test.tsx

Other (2) +2 / -0
package.jsonExpose a root benchmark command +1/-0

Expose a root benchmark command

• Adds test:bench to delegate to the app workspace, making the opt-in benchmark runnable from the repository root.

package.json

package.jsonAdd the app workspace benchmark runner +1/-0

Add the app workspace benchmark runner

• Adds test:bench to run matching benchmark tests with BENCH and CI enabled and watch mode disabled.

packages/app/package.json

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Code Review by Qodo


Action required

1. App navigation misses the routing fix 🐞 Bug ⭐ New
Description
The new resolution for @backstage/frontend-app-api leaves frontend-defaults’ transitive
npm:^0.16.7 dependency associated with the unpatched package in yarn.lock. The production app
obtains createApp from frontend-defaults, while the benchmark imports the patched package
directly, so the benchmark exercises a different route resolver from the one recorded for normal app
navigation.
Code

package.json[64]

+    "@backstage/frontend-app-api@npm:^0.16.7": "patch:@backstage/frontend-app-api@npm%3A0.16.7#~/.yarn/patches/@backstage-frontend-app-api-npm-0.16.7-bec820714f.patch"
Relevance

●● Moderate

No dismissed or rejected precedent matches patch-resolution or lockfile routing concerns closely;
rejections found are CI or inventory-related. Evidence is absent, so uncertain.

PR-#5297
PR-#5036

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The app imports createApp through frontend-defaults, whose lockfile dependency is npm:^0.16.7.
The lockfile retains an unpatched frontend-app-api entry for that descriptor’s package while
listing the new patch separately for the app workspace’s direct dependency; the benchmark directly
imports frontend-app-api.

packages/app/src/App.tsx[1-2]
yarn.lock[2482-2490]
yarn.lock[2430-2458]
yarn.lock[12504-12508]
packages/app/src/scale.bench.test.tsx[49-52]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The checked-in lockfile still associates `frontend-defaults`’ route resolver dependency with the unpatched package, although the app’s direct import and benchmark use the patch.

## Fix Focus Areas
- package.json[64-64]
- yarn.lock[2430-2489]
- packages/app/package.json[63-63]

## Recommended Fix
Update the dependency resolution and regenerate the lockfile so the `npm:^0.16.7` descriptor used by `frontend-defaults` resolves to the patched package. Verify the production `createApp` path and the benchmark load the same patched resolver.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

2. Container builds fail to install 🐞 Bug
Description
The sidebar patch changes the Backstage package without updating the content-sensitive patch locator
hash in yarn.lock. When the container build runs yarn install --immutable, Yarn resolves a
locator different from the locked one and rejects the required lockfile update.
Code

.yarn/patches/@backstage-core-components-npm-0.18.13-4947d892c0.patch[R65-69]

++    const key = JSON.stringify(sidebarConfig);
++    let cached = sidebarStylesCache.get(key);
++    if (!cached) {
++      cached = makeSidebarStyles(sidebarConfig);
++      sidebarStylesCache.set(key, cached);
Relevance

●● Moderate

Specific lockfile-hash claim is plausible, but it is a semantic build concern with no matching
precedent found.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The added patch hunks change the patch contents, but yarn.lock still records the locator with
hash=c5304c; this repository's pinned Yarn resolver derives that hash from patch contents. The
container build uses --immutable, which aborts if installation would modify the lockfile.

.yarn/patches/@backstage-core-components-npm-0.18.13-4947d892c0.patch[58-72]
yarn.lock[2292-2294]
build/containerfiles/Containerfile[98-98]
.yarn/patches/@backstage-core-components-npm-0.18.13-4947d892c0.patch[54-73]
package.json[60-64]
🌐 Yarn states that --immutable aborts when an install would modify the lockfile.
Skill: patch-backstage

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The edited Backstage patch changes its content-sensitive Yarn patch locator, but the committed lockfile retains the old hash, causing immutable installs to fail.

## Fix Focus Areas
- .yarn/patches/@backstage-core-components-npm-0.18.13-4947d892c0.patch[54-92]
- yarn.lock[2292-2294]

## Recommended Fix
Run `yarn install` with the repository's pinned Yarn version to regenerate `yarn.lock`, commit the updated patch resolution and checksum, then verify that `yarn install --immutable` succeeds and the dependency resolves through the patch locator.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


View medium (4)
Remediation recommended
3. Single-extension runs time out 🐞 Bug
Description
BENCH_SIZES accepts a count of 1, but every navigation series still runs hops to both /dyn-0
and /dyn-1. With only one page or entity content extension, the second target does not exist, so
the benchmark waits for its missing text and fails rather than reporting that size.
Code

packages/app/src/scale.bench.test.tsx[R434-436]

+    const sizes = (process.env.BENCH_SIZES ?? "2,10,50,100,200,400")
+      .split(",")
+      .map(Number);
Relevance

●●● Strong

Real deterministic bug: count 1 makes the fixed /dyn-1 hop wait forever. No close precedent either
way; leaning yes on obvious-bug prior.

PR-#2808

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The size is parsed without a minimum at lines 434–436. Page and content extensions are created only
while i is below the requested count, but both fixed hops include index 1; the resulting wait for
page-body-1 or content-body-1 cannot complete for a count of one.

packages/app/src/scale.bench.test.tsx[276-306]
packages/app/src/scale.bench.test.tsx[324-331]
packages/app/src/scale.bench.test.tsx[433-449]
packages/app/src/scale.bench.test.tsx[457-493]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A `BENCH_SIZES` value of `1` creates only one extension in the selected series, while the benchmark always navigates to two targets and times out.

## Fix Focus Areas
- packages/app/src/scale.bench.test.tsx[433-449]
- packages/app/src/scale.bench.test.tsx[457-493]

## Recommended Fix
Either support single-extension runs by selecting only routes that exist, or validate that every requested size is at least two before registering the benchmark cases and report a clear error.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

4. Route timings include missing routes 🐞 Bug
Description
makeWiringFeatures stores a route reference for every plugin, but only declares that route when
the plugin has a page. In each 100-page/100-content scenario, runWiring resolves references from
all 200 plugins, so half its samples target content-only plugins with no declared route.
Code

packages/app/src/scale.bench.test.tsx[159]

+    routeRefs.push(rootRef);
Relevance

●● Moderate

Plausible measurement-correctness issue in the benchmark setup. No matching accepted or rejected
precedent found for route-ref sampling.

PR-#5436

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The reference is collected before page count is considered; route registration is conditional on a
page, while the resolution loop samples every collected reference. The 200-plugin scenario gives
pages to only the first 100 plugins.

packages/app/src/scale.bench.test.tsx[156-162]
packages/app/src/scale.bench.test.tsx[197-203]
packages/app/src/scale.bench.test.tsx[249-257]
packages/app/src/scale.bench.test.tsx[395-400]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The wiring benchmark times route references from plugins that have no declared page route.
## Fix Focus Areas
- packages/app/src/scale.bench.test.tsx[156-162]
- packages/app/src/scale.bench.test.tsx[249-257]
## Recommended Fix
Collect references only for plugins with a page route, then iterate over that collection when measuring resolution.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

5. Navigation metrics omit route URL work 🐞 Bug
Description
instrumentRouteResolution stops its timer when resolve returns, without timing the resolver
function that it returns. When navigation invokes that function, the reported resolve duration
excludes its work even though the wiring benchmark includes it in its per-call timing.
Code

packages/app/src/scale.bench.test.tsx[127]

+      return original(...args);
Relevance

●● Moderate

Real timing bug, but no close precedent on benchmark timers. Accepted correctness fixes in test
instrumentation exist, but none match this case.

PR-#5436

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The instrumentation returns original(...args) inside the timed block, whereas the wiring benchmark
explicitly invokes the returned resolver before ending its measurement. Navigation reports the
instrumented duration as route-resolution time.

packages/app/src/scale.bench.test.tsx[120-131]
packages/app/src/scale.bench.test.tsx[249-257]
packages/app/src/scale.bench.test.tsx[369-375]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The navigation benchmark times only creation of a route resolver, omitting calls to the returned function.
## Fix Focus Areas
- packages/app/src/scale.bench.test.tsx[120-132]
- packages/app/src/scale.bench.test.tsx[370-376]
## Recommended Fix
Wrap the function returned by `resolve` and record its invocation time as well, while preserving its arguments, return value, and call count.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

6. Initial render timing can stop at sidebar 🐞 Bug
Description
runNavigation ends its firstRender timer when any element with the text Catalog appears,
rather than when the catalog route is ready. The app also has a Catalog navigation label, so the
sidebar can satisfy this wait before the page content has rendered.
Code

packages/app/src/scale.bench.test.tsx[R353-354]

+  await screen.findAllByText('Catalog', {}, { timeout: 120_000 });
+  const firstRender = window.performance.now() - renderStart;
Relevance

●● Moderate

Generic text wait may match sidebar. No precedent on this wait-selector pattern, and dismissed or
rejected history in this area is unrelated.

PR-#5436

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The benchmark starts at /catalog but waits only for the generic Catalog text. The repository
also defines Catalog as a menu-item label; unlike subsequent navigations, this wait does not
identify route-specific body content.

packages/app/src/scale.bench.test.tsx[339-354]
packages/app/src/translations/rhdh/ref.ts[25-30]
packages/app/src/scale.bench.test.tsx[324-331]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The initial-render measurement can finish when the sidebar label appears, before the catalog page is ready.
## Fix Focus Areas
- packages/app/src/scale.bench.test.tsx[351-354]
## Recommended Fix
Wait for a catalog-page-specific content element or another readiness signal that cannot be satisfied by the navigation shell before recording `firstRender`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


View low (1)
Informational
7. Benchmark instructions cannot run 🐞 Bug
Description
The benchmark's usage comment points yarn test at
packages/frontend-defaults/src/scale.bench.test.tsx, which is not the path of the added test. A
developer following that command cannot select this benchmark; the working invocation is the
separately added test:bench script.
Code

packages/app/src/scale.bench.test.tsx[23]

+ *   BENCH=1 CI=1 yarn test packages/frontend-defaults/src/scale.bench.test.tsx
Relevance

●●● Strong

Trivial deterministic fix: usage comment names the wrong path; no rejection precedent found.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The comment names packages/frontend-defaults, but the added file is under packages/app/src; the
root package defines test:bench to run the app workspace's benchmark command.

packages/app/src/scale.bench.test.tsx[17-23]
package.json[16-17]
packages/app/package.json[35-36]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The benchmark usage comment names a nonexistent test path and does not invoke the new benchmark script.
## Fix Focus Areas
- packages/app/src/scale.bench.test.tsx[21-23]
- package.json[17-17]
## Recommended Fix
Replace the usage example with `yarn test:bench`, optionally showing the supported environment variables.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


@christoph-jerolimov
christoph-jerolimov force-pushed the sidebar-performance-release-2.1 branch from e314e17 to 96f368e Compare November 30, 2026 09:23
@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.02%. Comparing base (ae9370b) to head (7571e8d).
⚠️ Report is 3 commits behind head on release-2.1.

Additional details and impacted files
@@             Coverage Diff              @@
##           release-2.1    #5933   +/-   ##
============================================
  Coverage        76.02%   76.02%           
============================================
  Files               64       64           
  Lines              705      705           
  Branches           100      100           
============================================
  Hits               536      536           
  Misses             168      168           
  Partials             1        1           
Flag Coverage Δ
rhdh 76.02% <ø> (ø)
Components Coverage Δ
Backend plugins 100.00% <ø> (ø)
Backend app 79.91% <ø> (ø)
Frontend app 61.03% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae9370b...7571e8d. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@christoph-jerolimov christoph-jerolimov changed the title [release-2.1] perf(ui): add frontend system scale benchmark [release-2.1] perf(ui): fix performance issue with high number of pages Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

christoph-jerolimov and others added 3 commits November 30, 2026 12:58
Adds an opt-in benchmark that measures app tree creation, route
resolution and route change time as the number of plugins, page
extensions and entity content extensions grows. It is skipped unless
the BENCH environment variable is set.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Each sidebar item created its own style hook, which attached a separate
style sheet for every item. The hooks are now shared between all
components with an equal sidebar config.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Each Box in a sidebar item attached its own dynamic style sheet, three
per item. None of them carried any styles, so they are replaced with
plain elements.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
@christoph-jerolimov
christoph-jerolimov force-pushed the sidebar-performance-release-2.1 branch from 13f51e4 to 6c71fff Compare November 30, 2026 12:28
@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

Each route resolution matched the source location against the entire
route tree. The cost grows with the number of routes in the app and is
paid by every caller on every location change. The matches for the most
recently used source locations are now cached.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-ocp-helm

@christoph-jerolimov

christoph-jerolimov commented Dec 1, 2026 •

Copy link
Copy Markdown
Member Author

e2e errors are related to keycloak, not this change

/retest

@christoph-jerolimov

Copy link
Copy Markdown
Member Author

/retest

@openshift-merge-bot
openshift-merge-bot Bot merged commit 1f12312 into redhat-developer:release-2.1 Dec 1, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants