-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Stabilizes graph click handlers and memoizes heavy computations to reduce re-renders across dashboard widgets, panel wrapper, and Celery/Metrics/Messaging Queues graphs.
PanelWrapperviaReact.memowith customarePropsEqualusing deepisEqualforwidgetandqueryResponse.data.payload.chartDatainUplotPanelWrapperwithuseMemoto avoid repeatedgetUPlotChartDatawork.useResolveQueryby referencingmutateAsyncwithuseRef.frontend/src/container/GridCardLayout/GridCard/WidgetGraphComponent.tsx):useCallback(onDelete,onClone,onView, modal toggles,graphClickHandler).isGraphClickButtonEnabledand unify click handling via stableclickHandler.CeleryTaskBar: memoizedonGraphClickand added per-state click handlers (onAllStateClick,onFailedStateClick,onRetryStateClick,onSuccessStateClick).MetricsApplication/Tabs/External.tsx: extracted and memoized click handlers for error %, duration, RPS by address, and duration by address.MessagingQueues/MQGraph: memoizedonClickHandlerand reused acrossGridCard.Written by Cursor Bugbot for commit c0bd545. This will update automatically on new commits. Configure here.