[dashboard][performance] dashboard grid item performs 2 DOM queries every render #199361
Labels
bug
Fixes for quality problems that affect the customer experience
Team:Presentation
Presentation Team for Dashboard, Input Controls, and Canvas
#182535 updated src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx with 2
document.querySelector
queries every render. In a worse case, I logged this as a 50 millisecond delay but most delays are less then one millisecond.Instead, these DOM elements should be passed to the DashboardGridItem as props. As an added benefit, props will decouple the DashboardGridItem component from internal selector implementations of the components that are getting searched for.
To see the effect I added some performance metrics around the code
When rendering web logs sample data dashboard the output is
There is a larger performance penalty when moving a panel around as seen below
The text was updated successfully, but these errors were encountered: