This is the raster performance that I am getting from drawing a path with 200k lines:
https://i.sstatic.net/65uYK9aB.png
I am trying to create a custom graph using using CustomPainter, and find it a bit odd that it would take this long to render 200k lines in Flutter while libraries like Python’s Matplotlib could easily handle millions of points.
When going beyond 200k points, the rendering will take even longer (And sometimes up to several minutes).
During this time, the UI becomes unresponsive until the rendering finishes.
The path is being drawn using this code:
canvas.drawPath(
linePath,
Paint()
..color = Colors.orange
..style = PaintingStyle.stroke
..strokeWidth = 2,
);
It seems to me from the screenshot that the problem is with the raster thread.
Are there any performance optimizations that can be done with canvas.drawPath
to things up? If there is no way to speed it up, are there any alternatives to this?
user25216198 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.