dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Add root product to improve performance of nav change within inExplorer products

Open nwmac opened this issue 1 year ago • 1 comments

Fixes #10407

This PR improves the performance when switching between child products of explorer - to test, in a downstraam cluster, install Longhorn and NeuVector from Cluster Tools - these are two simple products that sit within the Explorer product that we can use for testing, as the time taken to switch between them represents the overhead in our nav code paths.

With this PR, switching between them is much faster as the 'rootProduct' (explorer) does not change, even though the current (child) product does - this means less gets re-evaluated.

Before this change, it takes in the order of ~250ms to switch between Longhorn and NeuVector - this is primarily because our nav code believes the product has changed, so we have to call getGroups - with this PR, the top-level/root product does not change, so we do not have to call getGroups which reduces the time to change nav.

We also wire rootProduct into a few places to decide whether to show buttons in the header - which again don't need to be re-evaluated if the root product has not changed.

Before: ~250ms image

After: ~140ms image

nwmac avatar Feb 13 '24 15:02 nwmac

@richard-cox I have made updates for your comments.

I could not reproduce the issue with 'infinite loop' - could you check again - its also rebased to use the new backend.

nwmac avatar Mar 05 '24 17:03 nwmac