Skip to content

[charts][regression] Performance regression on upgrade to v8 in value formatter #17367

Closed
@MonstraG

Description

@MonstraG

Steps to reproduce

Steps:

  1. Open this link to live example: https://codesandbox.io/p/sandbox/stupefied-forest-9jxvzz
  2. open the preview url (will look something like https://9jxvzz.csb.app/) (required for next step)
  3. toggle "Highlight updates when components render." in React Developer Tools
  4. hover over chart

Current behavior

Even though all of my props for BarChart are stable, there are tons of rerenders for tooltip content:

Image

There are a lot of rerenders in the old version, but in new, around 10 seem to happen for one short movement of the mouse.

Expected behavior

Less rerenders, faster performance.

Context

Potentially, my valueFormatter function is suboptimal and is contributing to the problem, but that wasn't a problem in v7. Suggestions on improvement are welcome too.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: performance, regression, tooltip, value formatter, valueFormatter, chart

Metadata

Metadata

Assignees

Labels

bug 🐛Something doesn't workcomponent: chartsThis is the name of the generic UI component, not the React module!

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions