-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issue: drawCircles(context: CGContext) in LineChart #3798
Comments
I'm confused,
do you have issue now or solved? |
The issue is still there. I have blocked non-disabling func drawCircles with 'return' in the beginning, because I don't need it in my package. The issue IMHO that it shouldn't been called when drawCirclesEnabled = false |
I'm not very sure what you mean, but I'm guessing you are saying that you don't need to draw circles, but I looked into the code, if !dataSet.isDrawCirclesEnabled
{
continue
} is called inside for instance, I can move it to for i in 0 ..< dataSets.count
{
guard let dataSet = lineData.getDataSetByIndex(i) as? ILineChartDataSet else { continue }
if !dataSet.isVisible || dataSet.entryCount == 0 // <-- add !dataSet.isDrawCirclesEnabled here
{
continue
} So we can skip some code, can you try it out if it solves your perf issue? |
seems we will fix this in #3164 |
Yep, that's it. Can confirm. It fixes the issue. Moved it up in "if" statement. Thank you! Have a nice day |
Hello, Daniel
I used MPAndroidCharts with very good performance for my LineCharts (a number of lines up to 40 000 and more points for each one). I'm very happy that you could migrate this library to iOS. Thank you very much.
I wonder why on iOS my charts rendering causes too long and heavy CPU load. So, rendering takes too much time comparing to MPAndroidCharts.
Under profiler I see that 100% eats drawCircles() /copy and release blocks/, despite being disabled and the circles are really not shown:
lineDataSets[i].drawCirclesEnabled = false lineDataSets[i].drawCircleHoleEnabled = false //added that just for case
So, I remember very well that if I enable drawCircles for big datasets on Android it's getting slow as I have here with "disabled" circles.
P.S.
private func drawCircles(context: CGContext) { return
saved me. All the heavy load (100%) now is on aa_render CoreGraphics. That's ok. The same chart rendering takes 2s. 20! times faster. Hehe ;)
The text was updated successfully, but these errors were encountered: