ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.52k stars 5.99k forks source link

drawRect Performance issue, While scrolling #2217

Open aelam opened 7 years ago

aelam commented 7 years ago

When scrolling The performance goes down after loaded more than 400 visible entries of data for each dataSet of around 6 dataSets. The performance is good when less than 100 visible entries for each dataSet

I'm wondering if ShapeLayer and Bezier could help then hand out the drawRect staff to GPU

screen shot 2017-03-03 at 4 55 53 pm

liuxuan30 commented 7 years ago

how about your FPS? Just talking about ms does not make much sense. I used to test ~1000 data entries, the animation will start lagging, you have 400 * 6 = 2400 entries, which seems starting dropping

aelam commented 7 years ago

20-30 fps.

I've tries several stock apps, which are extremely smooth. I'm not very sure if they are rendering by GPU. It is possible that they don't allow to zoom out to show too many entries on screen And I also compared mine to 牛股王 at the same scale. still not good as it.

I was trying to let NSUIView inherit from GLKView, the conflict for GLKViewDelegate and ChartViewDelegate is the first breakdown both of ChartBaseView and GLKView have a property delegate. Can't make them together in ChartBaseView

牛股王: https://itunes.apple.com/us/app/niu-gu-wang-gu-piao-chao-gu/id855046551?mt=8 自选股: https://itunes.apple.com/cn/app/自选股-腾讯官方出品/id485653572?mt=8

liuxuan30 commented 7 years ago

Yeah, GPU is one thing. Have you tried not to use animation, zooming feature to see if it's smoother?

aelam commented 7 years ago

It's the drawing during decelerating

Sent from my iPhone

On 10 Mar 2017, at 11:12 AM, Xuan notifications@github.com wrote:

Yeah, GPU is one thing. Have you tried not to use animation, zooming feature to see if it's smoother?

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.