Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-9083

(Topology performance) User settings hook should not rerender for components which listen to an unaffected key

XMLWordPrintable

    • Moderate
    • None
    • Unspecified
    • If docs needed, set a value

      Description of problem:
      As a user of the console I want to have a great performance experience also when displaying many many nodes in the topology graph. For this, we should avoid unnecessary re-renderings.

      `useUserSettings` currently monitored the ConfigMap with a `useK8sWatchResource` hook, this triggers a re-rendering when ANY change to the settings was changed in the ConfigMap, also if the current user setting key is not related to this change.

      This happen for example if the user moves a topology node (latest position was saved then in the ConfigMap) and re-renders the complete app tree because there are watchers for the latest/prefered perspective and project.

      Version-Release number of selected component (if applicable):
      4.8+

      How reproducible:
      Always

      Steps to Reproduce:
      1. Install the react dev tools in your browser
      2. Enable the option to highlight renderings
      3. Move a topology node

      Actual results:
      Much more than needed renderings

      Expected results:
      Fewer renderings, esp. components which use the `useUserSettings` hook with another key should not be re-render.

      Additional info:
      We might implement this with a `Context` that watches the resource on a single level and register listeners in the `useUserSettings` hook.

              cjerolim Christoph Jerolimov
              cjerolim Christoph Jerolimov
              Sanket Pathak Sanket Pathak
              Red Hat Employee
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: