imaNNeo / fl_chart

FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
https://flchart.dev
MIT License
6.87k stars 1.78k forks source link

Improve performance on calculating minX, maxX, minY and maxY in axis-based charts #1693

Open imaNNeo opened 5 months ago

imaNNeo commented 5 months ago

There was a memory leak issue on caching the calculated values here: #1106 We removed the caching logic to fix the memory issue by accepting the computation cost trade-off for now (because we don't have a quick solution for it)

The solution is moving the caching logic into the renderer objects. We can keep and update the calculated values only when the data is changed (as you know renderer objects remain the same as long as we have the widget in the widget tree)

So I just created this issue to follow up this improvement for later.