-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Perf: panel rerenders #9497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Perf: panel rerenders #9497
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 3
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
frontend/src/container/GridCardLayout/GridCard/WidgetGraphComponent.tsx
Outdated
Show resolved
Hide resolved
|
Checking... |
|
it seems to behaving differently on test data vs real-world data, we are testing more about it. |
|
Disregard my last comment. Took a latest pull and reviewing again. |
|
We will get this merged. I have noted some questions about the hooks and their current functionality and implications on perf but we will come back to them later. |
📄 Summary
Fixes performance issues causing unnecessary re-renders of dashboard panels on user interactions. Stabilizes click handlers and optimizes component memoization to eliminate rendering lag across dashboards, metrics views, and graph components.
✅ Changes
Core Performance Fixes:
PanelWrapperwithReact.memousing deep equality comparison (isEqual) to prevent re-renders when props have identical contentchartDatainUplotPanelWrapperto avoid recalculation on every renderuseRefinuseResolveQueryto stabilizemutateAsynccallback dependenciesDashboard Widgets (
WidgetGraphComponent):graphVisibilitystate and derived flagsuseCallback:onDelete,onClone,onView, modal toggles,graphClickHandlerclickHandlerreferenceGraph Components:
onGraphClickand created dedicated handlers per state (onAllStateClick,onFailedStateClick,onRetryStateClick,onSuccessStateClick)onClickHandlerwith stable callbackNote
Optimizes dashboard and metrics graphs by memoizing components/data and stabilizing click handlers to prevent unnecessary re-renders and improve responsiveness.
PanelWrapperwithReact.memousing customarePropsEqual(deep-comparewidgetandqueryResponse.data.payload).chartDatainUplotPanelWrapperand related options dependencies.mutateAsyncusage inuseResolveQueryviauseRefto trimuseCallbackdeps.WidgetGraphComponent):isGraphClickButtonEnabled; unifyclickHandlerwith stableuseCallback.useCallback: delete/clone/view, modal toggles, toggle model, graph click.onGraphClick; add dedicatedonAllStateClick/onFailedStateClick/onRetryStateClick/onSuccessStateClick.onClickHandler.Written by Cursor Bugbot for commit 346be7b. This will update automatically on new commits. Configure here.