Improve performance on calculating minX, maxX, minY and maxY in axis-based charts
- Dominant language
- Dart
- Stars
- 7.6k
- Forks
- 2k
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 2
Description
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.
Contributor guide
Research direction
Start by tracing how axis-based charts calculate minX, maxX, minY, and maxY, then inspect the renderer objects that retain chart state. Confirm how data changes are detected before relocating the caching behavior. Done means repeated calculations are avoided without reintroducing the memory leak described in #1106.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- data-visualization
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100