Giter Site home page Giter Site logo

Comments (7)

brynbodayle avatar brynbodayle commented on August 17, 2024

@umerkhan-apple Any thoughts on a way to tackle this?

I've been investigating and there doesn't seem to be an easy fix. The preparation and recreation of the OKGroupedBarChartView takes quite a long time and occurs every time cellForRowAtIndexPath is called so the scrolling really lags a lot. I've been testing on an iPod Touch 5g.

A few options I thought of, but not sure what the requirements are for the OKGroupedBarChartView are.

  1. Separate each of the components of the OKGroupedBarChartView into different UITableViewCells. So one cell for the title label, one cell for each of the bars, and one cell for the legend. This would allow each of these components to be reused as you scroll. It would also simplify the constraints for the cells, which is part of the reason it's taking a while to prepare. The major downside to this approach is it's a bit more complex, and you don't have a reusable OKGroupedBarChartView.
  2. Add more caching for the OKGroupedBarChartView and reuse the views more, as opposed to recreating them every time. My hesitancy to this approach is that I'm not sure if it's possible to achieve optimal performance since these bar charts are pretty CPU-bound.

from carekit.

YuanZhu-apple avatar YuanZhu-apple commented on August 17, 2024

Separate each of the components of the OKGroupedBarChartView into different UITableViewCells. So ?one cell for the title label, one cell for each of the bars, and one cell for the legend. This would allow each of these components to be reused as you scroll. It would also simplify the constraints for the cells, which is part of the reason it's taking a while to prepare. The major downside to this approach is it's a bit more complex, and you don't have a reusable OKGroupedBarChartView.

This would be really complex.

Add more caching for the OKGroupedBarChartView and reuse the views more, as opposed to recreating them every time. My hesitancy to this approach is that I'm not sure if it's possible to achieve optimal performance since these bar charts are pretty CPU-bound.

This could be the way to go. Quick workaround would be create a custom OCKBarChart subclass which support chartview caching.

Also can you share with us how many bars on each of chart?

from carekit.

brynbodayle avatar brynbodayle commented on August 17, 2024

This could be the way to go. Quick workaround would be create a custom OCKBarChart subclass which support chartview caching.

Ah, I'll try this then.

I'm just looking at the test app, which has two charts, 7 bars each.

from carekit.

mikehouse avatar mikehouse commented on August 17, 2024

Caching is a great idea. I tried it out when I found this issue and it worked perfect... but the first instantiation anyway lasts too long. Thanks!

from carekit.

akshay-yadav-apple avatar akshay-yadav-apple commented on August 17, 2024

Hey @mikehouse !
Do you need further assistance with this issue?

from carekit.

mikehouse avatar mikehouse commented on August 17, 2024

Hello, @akshay-yadav-apple, this issue is all yours :). Past time I was busy and didn't push changes to fix this. Now I even don't remember what it was about. Thanks.

from carekit.

Pariecemckinney-apple avatar Pariecemckinney-apple commented on August 17, 2024

Closing due to inactivity. Please feel free to reopen if you would like the conversation to continue.

from carekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.